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> {
  ValuePreset copyWith() {...}
  ValuePreset lerp(other, double t) {...}
  ValuePreset merge(other) {...}
  Map<String, dynamic> toJson() {...}




hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type Object
The extension's type.
no setterinherited


copyWith() ThemeExtension<T>
Creates a copy of this theme extension with the given fields replaced by the non-null parameter values.
lerp(covariant ThemeExtension<T>? other, double t) ThemeExtension<T>
Linearly interpolate with another ThemeExtension object.
merge(T? other) → T
merge other into this preset. Works as copyWith with all it's entry arguments assigned to other's corresponding fields.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
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.


operator ==(Object other) bool
The equality operator.

Static Methods

of<T extends PresetValue<T>>(BuildContext context) → T?
Retrieve an instance of PresetValue of type T from context. If context doesn't contain any PresetValue instance of type T, this method will return null.
parse<T extends PresetValue<T>>(String source) Map<String, dynamic>
Retrieve an instance of PresetValue of type T from context. The returned instance of T will be in it's encoded form. Implement T.fromJson to decode an actual instance of T from the data returned.