LifecycleModule class abstract
Intended to be extended by most base module classes in order to provide a unified lifecycle API.
- Inheritance
-
- Object
- SimpleModule
- LifecycleModule
- Implementers
Constructors
Properties
- activeSpan → Span?
-
If this module is in a transition state, this is the Span capturing the
transition state.
no setter
- api → Object?
-
The api object should contain all public methods that a consumer can use
to mutate module state (methods) or query existing module state (getters).
no setterinherited
-
childModules
→ Iterable<
LifecycleModule> -
List of child components so that lifecycle can iterate over them as needed
no setter
- components → ModuleComponents?
-
The components object should contain all react-dart compatible UI
component factory methods that a consumer can use to render module data.
no setterinherited
-
didDispose
→ Future<
Null> -
A Future that will complete when this object has been disposed.
no setterinherited
-
didLoad
→ Stream<
LifecycleModule> -
The
LifecycleModule
was loaded.no setter -
didLoadChildModule
→ Stream<
LifecycleModule> -
A child
LifecycleModule
was loaded.no setter -
didResume
→ Stream<
LifecycleModule> -
The
LifecycleModule
was resumed.no setter -
didSuspend
→ Stream<
LifecycleModule> -
The
LifecycleModule
was suspended.no setter -
didUnload
→ Stream<
LifecycleModule> -
The
LifecycleModule
was unloaded.no setter -
didUnloadChildModule
→ Stream<
LifecycleModule> -
A child
LifecycleModule
was unloaded.no setter - disposableTypeName → String
-
A type name, similar to runtimeType but intended to work
with minified code.
no setterinherited
- disposalTreeSize → int
-
The total size of the disposal tree rooted at the current Disposable
instance.
no setterinherited
- events → Object?
-
The events object should contain all public streams that a consumer can
listen to for notification of internal module state change.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDisposed → bool
-
Whether this object has been disposed.
no setterinherited
- isInstantiated → bool
-
Whether the module is currently instantiated.
no setter
- isLeakFlagSet → bool
-
Whether the leak flag for this object has been set.
no setterinherited
- isLoaded → bool
-
Whether the module is currently loaded.
no setter
- isLoading → bool
-
Whether the module is currently loading.
no setter
- isOrWillBeDisposed → bool
-
Whether the disposal of this object has been requested, is in progress, or
is complete.
no setterinherited
- isResuming → bool
-
Whether the module is currently resuming.
no setter
- isSuspended → bool
-
Whether the module is currently suspended.
no setter
- isSuspending → bool
-
Whether the module is currently suspending.
no setter
- isUnloaded → bool
-
Whether the module is currently unloaded.
no setter
- isUnloading → bool
-
Whether the module is currently unloading.
no setter
- name ↔ String
-
Name of the module for identification in exceptions and debug messages.
getter/setter pair
- parentContext ← SpanContext?
-
Provide a way for a module to update its children's parentContext that is compatible with mocking in 2.19.
no getter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
willLoad
→ Stream<
LifecycleModule> -
The
LifecycleModule
is about to be loaded.no setter -
willLoadChildModule
→ Stream<
LifecycleModule> -
A child
LifecycleModule
is about to be loaded.no setter -
willResume
→ Stream<
LifecycleModule> -
The
LifecycleModule
is about to be resumed.no setter -
willSuspend
→ Stream<
LifecycleModule> -
The
LifecycleModule
is about to be suspended.no setter -
willUnload
→ Stream<
LifecycleModule> -
The
LifecycleModule
is about to be unloaded.no setter -
willUnloadChildModule
→ Stream<
LifecycleModule> -
A child
LifecycleModule
is about to be unloaded.no setter
Methods
-
awaitBeforeDispose<
T> (Future< T> future) → Future<T> -
Add
future
to a list of futures that will be awaited before the object is disposed.inherited -
dispose(
) → Future< Null> - Disposes this module and all its disposable dependencies.
-
flagLeak(
[String? description]) → void -
Flag the object as having been disposed in a way that allows easier
profiling.
inherited
-
getManagedDelayedFuture<
T> (Duration duration, T callback()) → Future< T> -
Creates a Future that will complete, with the value
returned by
callback
, after the given amount of time has elapsed.inherited -
getManagedDisposer(
Disposer disposer) → ManagedDisposer -
Automatically handle arbitrary disposals using a callback.
inherited
-
getManagedPeriodicTimer(
Duration duration, void callback(Timer timer)) → Timer -
Creates a periodic Timer that will be cancelled if active
upon disposal.
inherited
-
getManagedTimer(
Duration duration, void callback()) → Timer -
Creates a Timer instance that will be cancelled if active
upon disposal.
inherited
-
listenToStream<
T> (Stream< T> stream, void onData(T event), {Function? onError, void onDone()?, bool? cancelOnError}) → StreamSubscription<T> -
Returns a StreamSubscription which handles events from the stream using
the provided
onData
,onError
andonDone
handlers.inherited -
load(
) → Future< Null> - Public method to trigger the loading of a Module.
-
loadChildModule(
LifecycleModule? childModule) → Future< Null> - Public method to async load a child module and register it for lifecycle management.
-
manageAndReturnTypedDisposable<
T extends Disposable> (T disposable) → T -
Automatically dispose another object when this object is disposed.
inherited
-
manageCompleter<
T> (Completer< T> completer) → Completer<T> -
Ensure that a completer is completed when the object is disposed.
inherited
-
manageDisposable(
Disposable disposable) → void -
inherited
-
manageStreamController(
StreamController controller) → void -
Automatically cancel a stream controller when this object is disposed.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDidLoadChildModule(
LifecycleModule module) → Future< Null> - Custom logic to be executed when a child module has been loaded.
-
onDidUnloadChildModule(
LifecycleModule module) → Future< Null> - Custom logic to be executed when a child module has been unloaded.
-
onDispose(
) → Future< Null> -
Callback to allow arbitrary cleanup on dispose.
inherited
-
onLoad(
) → Future - Custom logic to be executed during load.
-
onResume(
) → Future< Null> - Custom logic to be executed during resume.
-
onShouldUnload(
) → ShouldUnloadResult - Custom logic to be executed during shouldUnload (consequently also in unload).
-
onSuspend(
) → Future< Null> - Custom logic to be executed during suspend.
-
onUnload(
) → Future< Null> - Custom logic to be executed during unload.
-
onWillDispose(
) → Future< Null> - Callback to allow arbitrary cleanup as soon as disposal is requested (i.e. dispose is called) but prior to disposal actually starting.
-
onWillLoadChildModule(
LifecycleModule module) → Future< Null> - Custom logic to be executed when a child module is to be loaded.
-
onWillUnloadChildModule(
LifecycleModule module) → Future< Null> - Custom logic to be executed when a child module is to be unloaded.
-
resume(
) → Future< Null> - Public method to resume the module.
-
shouldUnload(
) → ShouldUnloadResult - Public method to query the unloadable state of the Module.
-
specifyFirstUsefulState(
{Map< String, dynamic> tags = const {}, List<Reference> references = const []}) → void -
Creates a span with
globalTracer
from the start of load until now. -
specifyStartupTiming(
StartupTimingType specifier, {Map< String, dynamic> tags = const {}, List<Reference> references = const []}) → void -
Creates a span with
globalTracer
from the start of load until now. -
suspend(
) → Future< Null> - Public method to suspend the module.
-
toString(
) → String -
A string representation of this object.
inherited
-
unload(
) → Future< Null> - Public method to trigger the Module unload cycle.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited