Setting<T> class

A single setting that exposes a type T to the consuming application.

The _key is a function that returns the key for the setting. The _decode function is used to convert the raw value from the underlying storage to the type T. The _encode function is used to convert the value of type T to a raw value that can be stored in the underlying storage.

Constructors

Setting.new({required Settings settings, required String key, required T decode(RawSettingValue), required RawSettingValue encode(T)})
A single setting that exposes a type T to the consuming application.

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 ↔ WritableBeacon<T>
The value of the setting. Changing the setting can be done by assigning a new value to this property. The new value will be persisted to the underlying storage.
latefinal

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Resets the setting to its default value by invoking the _decode function with a NullSettingValue and setting value to the result.
toString() String
A string representation of this object.
inherited

Operators

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