StatefulSheetDelegateValue<T> class
A delegate that holds a static value.
This delegate always returns the same fixed value regardless of the sheet state or controller.
Typically used when you want to provide a constant value for a property of the sheet that does not depend on the controller's state or animations.
⚠️ Important: You should create this delegate outside the widget's build method —
ideally as a final field in a State class, or within a view model or other persistent scope.
Avoid constructing it inline within build() to ensure consistency and performance.
Example:
final delegate = StatefulSheetDelegateValue<int>(value: 42);
- Inheritance
-
- Object
- StatefulSheetDelegate<
T> - StatefulSheetDelegateValue
Constructors
- StatefulSheetDelegateValue({required T value})
-
Creates a delegate with a fixed static
value.const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → T
-
The fixed value returned by this delegate.
final
Methods
-
getStaticValue(
) → T? -
We need this method to get the value of the delegate if it is a static value.
We want to avoid calling the function every time we need the value and we can use this method in
init()to get the value of the delegate and store it in a variable.inherited -
getValue<
StateType> (MultiStateSheetController< StateType> controller) → T? -
inherited
-
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