@@ -399,18 +399,19 @@ class FirstTaskHandler extends TaskHandler {
399399 ),
400400 callback: updateCallback,
401401 );
402- } else {
403- FlutterForegroundTask.updateService(
404- notificationTitle: 'Hello FirstTaskHandler :)',
405- notificationText: timestamp.toString(),
406- );
407-
408- // Send data to main isolate.
409- final Map<String, dynamic> data = {
410- "timestampMillis": timestamp.millisecondsSinceEpoch,
411- };
412- FlutterForegroundTask.sendDataToMain(data);
402+ return;
413403 }
404+
405+ FlutterForegroundTask.updateService(
406+ notificationTitle: 'Hello FirstTaskHandler :)',
407+ notificationText: timestamp.toString(),
408+ );
409+
410+ // Send data to main isolate.
411+ final Map<String, dynamic> data = {
412+ "timestampMillis": timestamp.millisecondsSinceEpoch,
413+ };
414+ FlutterForegroundTask.sendDataToMain(data);
414415 }
415416
416417 @override
@@ -549,10 +550,20 @@ class MyTaskHandler extends TaskHandler {
549550
550551### :hatched_chick : other example
551552
552- * [ ` internal_plugin_service ` ] ( https://github.com/Dev-hwang/flutter_foreground_task_example/tree/main/internal_plugin_service ) (Recommend)
553- * [ ` location_service ` ] ( https://github.com/Dev-hwang/flutter_foreground_task_example/tree/main/location_service )
554- * [ ` record_service ` ] ( https://github.com/Dev-hwang/flutter_foreground_task_example/tree/main/record_service )
555- * [ ` geofencing_service ` ] ( https://github.com/Dev-hwang/flutter_foreground_task_example/tree/main/geofencing_service )
553+ #### [ ` internal_plugin_service ` ] ( https://github.com/Dev-hwang/flutter_foreground_task_example/tree/main/internal_plugin_service )
554+ An example of using the platform channel in project with ` flutter_foreground_task ` .
555+
556+ #### [ ` location_service ` ] ( https://github.com/Dev-hwang/flutter_foreground_task_example/tree/main/location_service )
557+ An example of a background location service implementation using ` flutter_foreground_task ` and ` fl_location ` .
558+
559+ #### [ ` record_service ` ] ( https://github.com/Dev-hwang/flutter_foreground_task_example/tree/main/record_service )
560+ An example of a voice record service implementation using ` flutter_foreground_task ` and ` record ` .
561+
562+ #### [ ` geofencing_service ` ] ( https://github.com/Dev-hwang/flutter_foreground_task_example/tree/main/geofencing_service )
563+ An example of a background geofencing service implementation using ` flutter_foreground_task ` and ` geofencing_api ` .
564+
565+ #### [ ` pedometer_service ` ] ( https://github.com/Dev-hwang/flutter_foreground_task_example/tree/main/pedometer_service )
566+ An example of a pedometer service implementation using ` flutter_foreground_task ` and ` pedometer ` .
556567
557568## More Documentation
558569
0 commit comments