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
Implementers

Constructors

PresetValue()
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
type Object
The extension's type.
no setterinherited

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 to other'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 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.