Last updated:
0 purchases
serviced
Basic Service management for dart
Features #
Lazy Services
Auto Start Services
Async Startup
Getting started #
import 'package:serviced/serviced.dart';
// This is a stateless service singleton
class TestStatelessService extends StatelessService {}
class TestService extends Service {
@override
void onStart() {
// Called before the service is started
}
@override
void onStop() {
// Called before the service is stopped
}
}
void main() async {
// Register services here
services().register(() => TestService());
// This service will be started automatically
services().register(() => TestStatelessService(), lazy: false);
// Start all services that are not lazy
await services().waitForStartup();
runApp(YourApp());
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.