PresetValue<T extends PresetValue<T> > class
abstract
Preset Value
Preset encodable value that gives you access to preset codec tools. Extend this class to define your own custom preset value.
class ValuePreset extends PresetValue<ValuePreset> {
//...Methods
@override
ValuePreset copyWith() {...}
@override
ValuePreset lerp(other, double t) {...}
@override
ValuePreset merge(other) {...}
@override
Map<String, dynamic> toJson() {...}
}
- Inheritance
-
- Object
- ThemeExtension<
T> - PresetValue
- Implementers
Constructors
- PresetValue()
-
const
Properties
Methods
-
copyWith(
) → ThemeExtension< T> -
Creates a copy of this theme extension with the given fields
replaced by the non-null parameter values.
inherited
-
lerp(
covariant ThemeExtension< T> ? other, double t) → ThemeExtension<T> -
Linearly interpolate with another ThemeExtension object.
inherited
-
merge(
T? other) → T -
merge
other
into this preset. Works as copyWith with all it's entry arguments assigned toother
's corresponding fields. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Convert this preset value to its encodable hashmap of String to it's encodable data. Override this method to declare how this field can be converted to it's encodable version.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
of<
T extends PresetValue< (T> >BuildContext context) → T? -
Retrieve an instance of PresetValue of type
T
fromcontext
. If context doesn't contain any PresetValue instance of typeT
, this method will return null. -
parse<
T extends PresetValue< (T> >String source) → Map< String, dynamic> -
Retrieve an instance of PresetValue of type
T
fromcontext
. The returned instance ofT
will be in it's encoded form. ImplementT.fromJson
to decode an actual instance ofT
from the data returned.