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

FlutterInheritedModel({String? name, bool useLifecycleState = false, bool useAsyncWorker = false, bool useSingleTickerProvider = false, bool useTickerProvider = false, Type? event})
An annotation that designates a model class to be generated as an InheritedModel widget.
const

Properties

event Type?
Specifies the Event type 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 InheritedModel widget to be generated.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
useAsyncWorker bool
Determines whether to use AsyncWorker for 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 SingleTickerProviderStateMixin to the widget.
final
useTickerProvider bool
Determines whether to add TickerProviderStateMixin to 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