Flutter Foreground Service
This plugin expects your application icon to be saved as
ic_launcher.png which is the default name.
If you use the package
flutter_launcher_icons to generate a new launcher icon, make sure to name the icon
Add the plugin to your pubspec.yaml file:
dependencies: flutter: sdk: flutter flutter_foreground_service: ^LATEST_VERSION_HERE
LATEST_VERSION_HERE the latest version number as stated on this page.
Import the package into your project
Check out the
example tab here on pub.dev to view the plugin in action.
In essence, the following line of code will start the foreground service:
To stop the service again, use the following line of code: