ReactterContext class abstract

A abstract-class that allows to manages the ReactterHooks and provides Lifecycle events.

RECOMMENDED: Name class with Context suffix, for easy locatily:

class AppContext extends ReactterContext {}

For access to instance anywhere, you need to register the instance using ReactterInstanceManager:

Reactter.register<AppContext>(() => AppContex());

// or
final appContext = Reactter.create<AppContext>(() => AppContex());

And later you can get the instance:

final appContext = Reactter.get<AppContext>();

or using UseContext hook:

final appContext = UseContext<AppContext>().instance;

If you use flutter, add flutter_reactter package on your dependencies and use its Widgets.

See also:

Inheritance
Implementers

Constructors

ReactterContext()

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

dispose() → void
Called when this object is removed
inherited
listenHooks(List<ReactterHook> hooks) → void
Suscribes to all hooks given.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refresh() → void
Forces update and notifies to listeners that it did update
inherited
toString() String
A string representation of this object.
inherited
update(covariant Function fnUpdate) → void
Executes fnUpdate, and notify the listeners about to update.
inherited
updateAsync(covariant Function fnUpdate) Future<void>
Executes fnUpdate, and notify the listeners about to update as async way.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited