NotifiedSettings class

Provides Preferences for immediate usage, without having to create a new class.

Can be used to create Preferences across multiple classes.

Mixed in types

Constructors

NotifiedSettings(SharedPreferences preferences)
Creates an instace of NotifiedSettings with the specified SharedPreferences.

Properties

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

Methods

clear() Future<bool>
Completes with true once the settings for the app have been cleared.
inherited
createEnumSetting<T extends Enum>({required String key, required T initialValue, required List<T> values}) PreferenceNotifier<T>
Creates an Enum Setting. The enum value is stored and read as by its name property.
override
createJsonSetting<T>({required String key, required T initialValue, required DecodeJsonPreference<T> fromJson}) PreferenceNotifier<T>
Creates a Preference that is encoded and decoded from json.
override
createSetting<T>({required String key, required T initialValue, ReadPreference<T>? read, WritePreference<T>? write}) PreferenceNotifier<T>
Creates a new Preference of type T. A key and an initial value have to be provided.
override
initialize([FutureOr<SharedPreferences>? preferences]) Future<void>
Initializes the NotifiedPreferences. This method should be called in your main method, before runApp.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reload() Future<void>
Fetches the latest values from the host platform.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

getInstance() Future<NotifiedSettings>
Creates an instace of NotifiedSettings with the default SharedPreferences.