getting error The method 'isScheduledByUniqueName' isn't defined for the type 'Workmanager'. Try correcting the name to the name of an existing method, or defining a method named 'isScheduledByUniqueName'.dartundefined_method Type: InvalidType
while using the workmanager
child: Text("isscheduled (Android)"),
onPressed: Platform.isAndroid
? () async {
final workInfo =
await Workmanager().isScheduledByUniqueName(
simplePeriodicTask,
);
print('isscheduled = $workInfo');
}
: null),
SizedBox(height: 8),
I have added a dependency workmanager
in my projects pubspec.yaml
file and also imported a package import 'package:workmanager/workmanager.dart';
bro i think this method Workmanager().isScheduledByUniqueName() is not define in Workmanager class.you can schedule task by this 2 methods.