beacon_settings library
Classes
- BoolSettingValue
- A raw value that represents a bool.
- DoubleSettingValue
- A raw value that represents a double.
- InMemoryStorage
- An implementation of Storage that stores data in memory.
- IntSettingValue
- A raw value that represents an int.
- NullSettingValue
-
A raw value that represents
null
. - RawSettingValue
- Base class for raw values extracted from the underlying storage. Used as the input for Decoders and the output for Encoders.
-
Setting<
T> -
A single setting that exposes a type
T
to the consuming application. - Settings
- A class that manages settings. Settings are persisted to an underlying Storage implementation. Each setting is represented by a Setting.
- Storage
- An interface used by Settings to persist values.
- StringListSettingValue
- A raw value that represents a List of Strings.
- StringSettingValue
- A raw value that represents a String.
Functions
-
boolDecoder(
{bool defaultValue = false}) → Decoder< bool> -
Decoder for a Setting that manages a bool. If the value is not in
the underlying Storage,
defaultValue
is returned. -
boolEncoder(
) → Encoder< bool> - Encoder for a Setting that manages a bool.
-
doubleDecoder(
{double defaultValue = 0.0}) → Decoder< double> -
Decoder for a Setting that manages a String. If the value is not in
the underlying Storage,
defaultValue
is returned. -
doubleEncoder(
) → Encoder< double> - Encoder for a Setting that manages a double.
-
intDecoder(
{int defaultValue = 0}) → Decoder< int> -
Decoder for a Setting that manages an int. If the value is not in
the underlying Storage,
defaultValue
is returned. -
intEncoder(
) → Encoder< int> - Encoder for a Setting that manages an int.
-
nullableStringDecoder(
) → Decoder< String?> -
Decoder for a Setting that manages a String. If the value is not in
the underlying Storage,
null
is returned. -
nullableStringEncoder(
) → Encoder< String?> - Encoder for a Setting that manages a String.
-
stringListDecoder(
) → Decoder< List< String> > - Decoder for a Setting that manages a List of Strings. If the value is not in the underlying Storage, an empty List is returned.
-
stringListEncoder(
) → Encoder< List< String> > - Encoder for a Setting that manages a List of Strings.
Typedefs
-
Decoder<
T> = T Function(RawSettingValue value) -
A function that converts a value of type
R
to a value of typeT
. -
Encoder<
T> = RawSettingValue Function(T) -
A function that converts a value of type
T
to a value of typeR
.
Exceptions / Errors
- SettingsException
- Exception thrown when there is an error in Settings.