fluttercommunity/flutter_uploader

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

nkenna opened this issue · 1 comments

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);

}`

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

eg Pubspec.yaml

  flutter_uploader:
    git: 
      url: git@github.com: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.