FlutterInheritedState class final
An annotation used to define a sub-state within a model class.
It allows for the separation of complex model states and logic into multiple smaller state classes, improving code readability and maintainability.
Example:
@FlutterInheritedState()
class UserProfileState with _$UserProfileState {
UserProfileState._();
factory UserProfileState() = _$UserProfileState;
@inheritedModelState
late String name;
}
@FlutterInheritedModel()
class MyModel with _$MyModel {
final userProfile = UserProfileState();
}
Constructors
- FlutterInheritedState({String? name, bool useAsyncWorker = false})
-
An annotation used to define a sub-state within a model class.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String?
-
Specifies the name of the sub-state class 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 sub-state class.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