flutter_background_service
flutter_background_service copied to clipboard
Provide onStopped callback for when the service is stop.
This will allow for cleaning up of resources when the service is stopped.
For example my background opens streams to firestore in the onStart method, and there is no way for me to call close on those streams when the service is killed.
When the service is stopped, the resources will be freed automatically because the isolate will be killed.
FlutterBackgroundService().invoke("stop_service", null);
i use this function and work it