flutter_uploader
flutter_uploader copied to clipboard
method 'setBackgroundHandler' isn't defined for the type 'FlutterUploader'
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: [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.