In the home_widget API, I'm using workmanager to refresh the widget. The Home_widget reads data from a database (isar db) and displays schedules from the phone's calendar (using the device_calendar API). However, while the data from the database is displayed correctly, the schedules are not being shown. (The method works correctly when executed directly within the app.)
I would like to know under what circumstances this issue could occur, and how I could debug to check if the execution is functioning properly.
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;
}
In the home_widget API, I'm using workmanager to refresh the widget. The Home_widget reads data from a database (isar db) and displays schedules from the phone's calendar (using the device_calendar API). However, while the data from the database is displayed correctly, the schedules are not being shown. (The method works correctly when executed directly within the app.)
I would like to know under what circumstances this issue could occur, and how I could debug to check if the execution is functioning properly.
@pragma("vm:entry-point") void callbackDispatcher() { Workmanager().executeTask((taskName, inputData) async { debugPrint( 'JH: ${DateTime.now().toString()}, Workmanger Doing!!!!!!!!!!!!!!!!!'); CommonData.isWorkManager = true;
}); }
Future<bool?> sendAndUpdate() async { try { // Ready to use await CommonData.init(); await WorktypeHelper().init(); await IsarHelper().initDB();
}