service_runner 1.0.2
service_runner: ^1.0.2 copied to clipboard
A lightweight Flutter package for service initialization with lifecycle management, splash screen support, and a global service registry.
1.0.2 - 2026-09-12 #
Changed #
- Replaced the
flutter_lintsdev dependency with thevibe_checkNylo lint preset and fixed all resulting analyzer issues - Added explicit local variable types in the
Runnableregistry (no behavior change) - Tightened the failed-initialization test to assert that a
ServiceInitializationExceptionis thrown instead of silently catching all errors
1.0.1 #
- Updated dependencies
1.0.0 #
Initial release.
Features #
- Service lifecycle management with four phases:
onInit(),onReady(),onAppReady(), andonDispose() - Splash screen support - display a widget while services initialize
- Global service registry - access services anywhere with
service<T>()andserviceOrNull<T>() - Async factory pattern - services can use
static Future<T> init()for async initialization - Explicit type registration - use
Runnable.add<T>()to register by interface type - Lifecycle callbacks -
onBeforeInitandonAfterInithooks inServiceRunner.init() - Error handling -
ServiceInitializationExceptionwith service name, phase, and original error - State tracking -
ServiceRunner.isInitializedandServiceRunner.isInitializingproperties - Concurrent initialization protection - throws if
init()is called while already initializing