FlutterInheritedModel class final
An annotation that designates a model class to be generated as an InheritedModel widget.
A class with this annotation will have code automatically generated by build_runner
for a widget that inherits from InheritedModel and for related state management.
Example:
@FlutterInheritedModel(name: 'MyDataModel')
class MyModel with $MyModel {
MyModel._();
factory MyModel() = _$MyModel;
// ...
}
Constructors
Properties
- event → Type?
-
Specifies the
Eventtype to use for handling one-way events between the model and the UI.final - hashCode → int
-
The hash code for this object.
no setterinherited
- name → String?
-
Specifies the name of the
InheritedModelwidget to be generated.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- useAsyncWorker → bool
-
Determines whether to use
AsyncWorkerfor safely handling asynchronous tasks within the model.final - useLifecycleState → bool
-
Determines whether the model should receive widget app lifecycle events.
final
- useSingleTickerProvider → bool
-
Determines whether to add
SingleTickerProviderStateMixinto the widget.final - useTickerProvider → bool
-
Determines whether to add
TickerProviderStateMixinto the widget.final
Methods
-
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