MVUProcessor<Model, Msg> class abstract

Detached MVU processor that can be used to dispatch messages from anywhere. It can be created from functions or subclassed. This is useful when you want to dispatch messages from outside the view. The processor can also be used with dependency injection to create a singleton.

Constructors

MVUProcessor()
MVUProcessor.fromFunctions({required (Model, Cmd<Msg>) init(), required (Model, Cmd<Msg>) update(Msg, Model), Subscription<Model, Msg>? subscriptions})
Create a new MVUProcessor from functions instead of subclassing.
factory

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

dispatch(Msg msg) → void
Dispatch a message to the processor.
init() → (Model, Cmd<Msg>)
Creates an initial model and a list of commands.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
subscribe(void handler(Model model, Dispatch<Msg> dispatch)) StreamSubscription<Model>
Subscribe to changes in the model. This can be used to update the UI.
subscriptions(Model model) Subs<Msg>
Creates a list of subscriptions using the model.
toString() String
A string representation of this object.
inherited
update(Msg msg, Model model) → (Model, Cmd<Msg>)
Creates an updated model and a list of commands from a message and the current model.
useModel<T>(T handler(Model model, Dispatch<Msg> dispatch)) → T
Use the current model and dispatch function. Can be used to return values and dispatch new messages depending on the current model.

Operators

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