MomentumModel<Controller extends MomentumController> class
abstract
The class which holds the state of your app. This is tied with MomentumController.
- Annotations
Constructors
- MomentumModel(Controller controller)
-
The class which holds the state of your app.
This is tied with MomentumController.
const
Properties
- controller → Controller
-
The instance of the controller this model is attached to.
final
- controllerName → String
-
A getter that exposes the controller
name that this model is attached to.
Just for debugging purposes.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
fromJson(
Map< String, dynamic> ? json) → MomentumModel<MomentumController> ? -
This is different from the usual factory
fromJson
method. It's an instance member because you wouldn't be able to access thecontroller
property otherwise. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> ? - Method to generate a map from this model.
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
) → void -
The method for updating this model.
Like a
setState(...)
but immutable. -
updateMomentum(
) → void -
A method which must be explicitly called
inside your
update()
implementation.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited