LifecycleObserver class abstract
It's a mixin that provides a set of methods that can be used to observe the lifecycle of a dependency.
Example usage:
class MyController with LifecycleObserver {
final state = UseState('initial');
@override
void onInitialized() {
print('MyController has been initialized');
}
@override
void onDidUpdate(RtState? state) {
print("$state has been changed");
}
}
// MyController has been initialized
final myController = Rt.create(() => MyController());
// state has been changed
myController.state.value = "value changed";
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onCreated(
) → void - This method is called when the dependency instance is created.
-
onDidMount(
) → void -
This method is called when the dependency has been successfully mounted
in the widget tree(exclusive to
flutter_reactter
). -
onDidUnmount(
) → void -
This method is called when the dependency has been successfully unmounted
from the widget tree(exclusive to
flutter_reactter
). -
onDidUpdate(
covariant StateBase? state) → void -
This method is called when the dependency's state has been updated.
The parameter is a
StateBase
. -
onInitialized(
) → void - This method is called when the dependency is initialized.
-
onWillMount(
) → void -
This method is called when the dependency is going to be mounted
in the widget tree(exclusive to
flutter_reactter
). -
onWillUnmount(
) → void -
This method is called when the dependency is going to be unmounted
from the widget tree(exclusive to
flutter_reactter
). -
onWillUpdate(
covariant StateBase? state) → void -
This method is called when the dependency's state is about to be updated.
The parameter is a
StateBase
. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited