SplashController class
Controls the lifecycle of the Smart Splash Kit.
Manages the onInit async callback, state transitions, performance timing, and error fallback routing.
- Inheritance
-
- Object
- ChangeNotifier
- SplashController
Constructors
-
SplashController({required Future<
SplashRoute> onInit(), int minimumDuration = 2000, SplashRoute? errorFallbackRoute, bool enablePerformanceMonitoring = false}) - Creates a SplashController.
Properties
- enablePerformanceMonitoring → bool
-
Whether to collect performance metrics (debug mode only).
final
- error → Object?
-
The error object, available when state is SplashState.error.
no setter
- errorFallbackRoute → SplashRoute?
-
The route to navigate to if onInit throws an error.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- loadTimeMs → int?
-
App load time in milliseconds (only available when enablePerformanceMonitoring is true).
no setter
- minimumDuration → int
-
Minimum display duration of the splash screen in milliseconds.
final
-
onInit
→ Future<
SplashRoute> Function() -
The async callback that returns the target SplashRoute.
final
- resolvedRoute → SplashRoute?
-
The resolved SplashRoute, available after state is SplashState.completed.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → SplashState
-
The current lifecycle state of the splash.
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
initialize(
) → Future< void> - Starts the splash initialization process.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
retry(
) → Future< void> - Retries initialization after an error.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited