cobi_flutter_service

Creator: coderz1093

Last updated:

0 purchases

cobi_flutter_service Image
cobi_flutter_service Images

Languages

Categories

Add to Cart

Description:

cobi flutter service

CobiFlutterService plugin #
This executes dart code in a second isolate while providing communication between the main and background isolates.
It also integrates with the device's status bar.
This plugin is currently only available for Android.
Usage #
To use this plugin, add cobi_flutter_service as a dependency in your pubspec.yaml file.
Then implement a runner function:
void serviceRunner(SendPort sendPort, ReceivePort receivePort) {
print("Service runner executed");
}
copied to clipboard
To prepare your app to run the background service, initialize it:
void main() {
WidgetsFlutterBinding.ensureInitialized();
CobiFlutterService.instance.initService(serviceRunner, true);
runApp(MyApp());
}
copied to clipboard
Then you can start the service by calling
CobiFlutterService.instance.startService();
copied to clipboard
For a more advanced use case, see the included example

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.