MastroBox<T extends MastroEvent> class
abstract
Base class for managing state and events in the Mastro framework.
Constructors
- MastroBox()
- Creates a new MastroBox instance.
Properties
Methods
-
addEvent(
T event, {Callbacks? callbacks}) → Future< void> - Adds an event to be processed.
-
addEventBlockPop(
BuildContext context, T event, {Callbacks? callbacks}) → Future< void> - Adds an event that blocks pop navigation while processing.
-
dispose(
) → void - Disposes of resources used by this box.
-
init(
) → void - Initializes the box. Override this to set up initial state.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerCallback(
{required String key, required void callback({Map< String, dynamic> ? data})}) → void - Registers a callback function with the given key.
-
tag(
{required String tag}) → void - Sets the current tag for this box.
-
toString(
) → String -
A string representation of this object.
inherited
-
trigger(
{required String key, Map< String, dynamic> ? data}) → void - Triggers a callback associated with the given key.
-
unregisterCallback(
{required String key}) → void - Unregisters a callback associated with the given key.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited