ReactterContext class abstract
A context 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:
- ReactterHook, a abstract hook that ReactterContext listen it.
- ReactterInstanceManager, a instances manager
- UseContext, a hook that allowed access to instance of ReactterContext.
- Inheritance
-
- Object
- ReactterHookManager
- ReactterContext
- Implementers
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
-
dispose(
) → dynamic - This methods is called for ReactterInstanceManager when the instance will be destroyed.
-
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
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited