FlutterInheritedModel constructor

const FlutterInheritedModel({
  1. String? name,
  2. bool useLifecycleState = false,
  3. bool useAsyncWorker = false,
  4. bool useSingleTickerProvider = false,
  5. bool useTickerProvider = false,
  6. Type? event,
})

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;
  // ...
}

Implementation

const FlutterInheritedModel({
  this.name,
  this.useLifecycleState = false,
  this.useAsyncWorker = false,
  this.useSingleTickerProvider = false,
  this.useTickerProvider = false,
  this.event,
});