You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"I am refreshing the home widget using workmanager. The widget draws data read from the local DB and the calendar schedule (using Device_Calendar API) onto a Canvas, saves it as an image, and then displays it. Strangely, the calendar schedule does not appear. (The method works correctly when executed directly within the app.) I would like some help to understand which part of workmanager I should check and what could be the problem, so I am writing this post."
Future<bool?> sendAndUpdate() async {
try {
// Ready to use
await CommonData.init();
await WorktypeHelper().init();
await IsarHelper().initDB();
await _imageMake(); // DB, get the schedule, draw the data imported to Canvas, and save it as an image file.(Prepare images for use in homewidget.)
await _sendData(); // Forwarding information (image) to the widget
await _updateWidget(); // update widget
"I am refreshing the home widget using workmanager. The widget draws data read from the local DB and the calendar schedule (using Device_Calendar API) onto a Canvas, saves it as an image, and then displays it. Strangely, the calendar schedule does not appear. (The method works correctly when executed directly within the app.) I would like some help to understand which part of workmanager I should check and what could be the problem, so I am writing this post."
@pragma("vm:entry-point")
void callbackDispatcher() {
Workmanager().executeTask((taskName, inputData) async {
debugPrint(
'JH: ${DateTime.now().toString()}, Workmanger Doing!!!!!!!!!!!!!!!!!');
CommonData.isWorkManager = true;
return Future.wait<bool?>([
HomeWidgetCalendarMaker(44).sendAndUpdate(),
HomeWidgetCalendarMaker(45).sendAndUpdate(),
HomeWidgetCalendarMaker(55).sendAndUpdate(),
]).then((value) {
return !value.contains(false);
});
});
}
Future<bool?> sendAndUpdate() async {
try {
// Ready to use
await CommonData.init();
await WorktypeHelper().init();
await IsarHelper().initDB();
await _imageMake(); // DB, get the schedule, draw the data imported to Canvas, and save it as an image file.(Prepare images for use in homewidget.)
await _sendData(); // Forwarding information (image) to the widget
await _updateWidget(); // update widget
return true;
} catch (e) {
debugPrint(e.toString());
return false;
}
}
The text was updated successfully, but these errors were encountered: