Settings class

This class behaves as a bridge between the settings screen widgets and the underlying storage mechanism.

To access the storage mechanism an instance of the CacheProvider implementation is required.

Any Flutter App using this library must call Settings.init(cacheProvider) before showing the settings screen.

Constructors

Settings()
Public factory method to provide the
factory

Properties

hashCode int
The hash code for this object.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

isInitialized bool
A getter to know if the settings are already initialized or not
read-only

Static Methods

clearCache() → void
method to clear all the cached data using the cacheProvider
containsKey(String key) bool
method to check if the cache provider contains given key or not.
ensureCacheProvider() → void
This method will check and ensure that _cacheProvider value is set properly.
getValue<T>(String key, T defaultValue) → T
method to get a value using the cacheProvider for given key
init({CacheProvider cacheProvider}) Future<void>
This method is used for initializing the _cacheProvider instance.
setValue<T>(String key, T value) Future<void>
method to set value using the cacheProvider for given key