Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

method 'setBackgroundHandler' isn't defined for the type 'FlutterUploader' #226

Open
nkenna opened this issue Apr 3, 2022 · 1 comment

Comments

@nkenna
Copy link

nkenna commented Apr 3, 2022

It seems setBackgroundHandler cannot be accessed from FlutterUploader()
I did copy the example code and still got this error.

The method 'setBackgroundHandler' isn't defined for the type 'FlutterUploader'.
Try correcting the name to the name of an existing method, or defining a method named 'setBackgroundHandler'.

FlutterUploader _uploader = FlutterUploader();
` @OverRide
void initState() {
super.initState();

_uploader.setBackgroundHandler(uploaderBackgroundHandler);
WidgetsBinding.instance.addObserver(this);

}`

@spatialbits
Copy link

spatialbits commented May 25, 2022

You'll need one of the beta releases, not the one in dart pub.

eg Pubspec.yaml

  flutter_uploader:
    git: 
      url: [email protected]:fluttercommunity/flutter_uploader.git
      tag: 3.0.0-beta.4

Edit: the 3.0.0-beta.4 tag isn't set in the repo. You could use whatever the latest one is or just reference a commit directly, which is probably better since 2.x tags are pretty old anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants