DefaultSettingsValue<T> class

A settings value that provides a default value if no value is specified by the user.

The value stored in this class is guaranteed to be non-null.

Example:

final setting = SettingsValue<int>(name: 'setting', defaultValue: 34);
final defaultSetting = DefaultSettingsValue<int>(name: 'default', defaultValue: 16);

// This value is of type int? even though it has a default value.
final value = setting.value;

// This value is of type int and not nullable.
final otherValue = defaultSetting.value;

Inheritance

Constructors

DefaultSettingsValue({required String name, required T defaultValue})
A settings value that provides a default value if no value is specified by the user.

Properties

defaultValue → T?
The value that is used by default.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
name String
The unique name of this setting.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value ↔ T
Get the value stored for name.
getter/setter pairoverride

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Resets the value of this SettingsValue to its default value.
inherited
toString() String
A string representation of this object.
inherited
watch() Stream<T?>
Watches this SettingsValue for changes.
inherited

Operators

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