serviced

Creator: coderz1093

Last updated:

0 purchases

TODO
Add to Cart

Description:

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

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.

Related Products

More From This Creator