fluttercommunity / flutter_workmanager

A Flutter plugin which allows you to execute code in the background on Android and iOS.
826 stars 247 forks source link

🐞 Inaccurate code in Readme file, the code in "How to use the package?" #500

Closed NullByte08 closed 9 months ago

NullByte08 commented 10 months ago

Version

Technology Version
Workmanager version
Xcode version
Swift version
iOS deployment target

Describe the error in callbackDispatcher() function's body, the variable backgroundTask is undefined.

void callbackDispatcher() {
  Workmanager().executeTask((task, inputData) {
    print("Native called background task: $backgroundTask"); //simpleTask will be emitted here.
    return Future.value(true);
  });
}

Output of flutter doctor -v