LifecycleObserver class abstract

It's a mixin that provides a set of methods that can be used to observe the lifecycle of an instance.

Example usage:

class MyController with LifecycleObserver {
  final state = UseState('initial');

  @override
  void onInitialized() {
    print('MyController has been initialized');
  }

  @override
  void onDidUpdate(ReactterState? state) {
    print("$state has been changed");
  }
}

// MyController has been initialized
final myController = Reactter.create(() => MyController());
// state has been changed
myController.state.value = "value changed";

Constructors

LifecycleObserver()

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
onDidMount() → void
This method is called when the instance has been successfully mounted in the widget tree(exclusive to flutter_reactter).
onDidUnmount() → void
This method is called when the instance has been successfully unmounted from the widget tree(exclusive to flutter_reactter).
onDidUpdate(covariant StateBase? state) → void
This method is called when the instance's state has been updated. The parameter is a StateBase.
onInitialized() → void
This method is called when the instance is initialized.
onWillMount() → void
This method is called when the instance is going to be mounted in the widget tree(exclusive to flutter_reactter).
onWillUnmount() → void
This method is called when the instance is going to be unmounted from the widget tree(exclusive to flutter_reactter).
onWillUpdate(covariant StateBase? state) → void
This method is called when the instance'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