ReignController<T> class
abstract
Base class for all state controllers in the Reign system.
Controllers manage business logic and state for your application. They automatically handle lifecycle events when used with ReignBuilder or ControllerProvider.
Example usage:
class CounterController extends ReignController<int> {
CounterController() : super(0);
void increment() {
value++;
update();
}
}
- Inheritance
-
- Object
- ChangeNotifier
- ValueNotifier<
T> - ReignController
- Mixed-in types
- Implementers
Constructors
- ReignController(T initialValue, {bool register = true})
- Creates a controller and optionally registers it with the ControllerStore.
Properties
- context ↔ BuildContext
-
The BuildContext of the nearest ControllerProvider ancestor.
getter/setter pair
- error ↔ Object?
-
getter/setter pair
- hasError ↔ bool
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isDisposed → bool
-
no setterinherited
- isInitialized → bool
-
no setterinherited
- isReady → bool
-
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- safeContext → BuildContext?
-
no setter
- type → Type
-
Returns the runtime type of this controller.
no setter
- value ↔ T
-
The current value stored in this notifier.
getter/setter pairinherited
Methods
-
addDisposable(
Disposable disposable) → void -
inherited
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
clearError(
) → void -
dependOn<
T extends ReignController> () → T -
Retrieves another controller of type
Tfrom the store. -
dispose(
) → void -
Disposes the controller, cleaning up resources and unregistering from the store.
override
-
handleAsync<
T> (Future< T> operation()) → Future<T> -
init(
) → void -
inherited
-
initialize(
) → void -
inherited
-
markReady(
) → void -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
onDispose(
) → void -
override
-
onInit(
) → void -
inherited
-
onReady(
) → void -
override
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
) → void - Notifies all listeners that the controller's state has changed.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited