Interface for key-value storage operations, allowing storage and retrieval of various data types. More...
Inherits Finalizable.
Public Member Functions | |
| bool | contains (String key) |
| List< String > | getKeys () |
| int | getInt (String key, int defaultValue) |
| int | getLong (String key, int defaultValue) |
| bool | getBool (String key, bool defaultValue) |
| double | getFloat (String key, double defaultValue) |
| double | getDouble (String key, double defaultValue) |
| String | getString (String key, String defaultValue) |
| void | putInt (String key, int value) |
| void | putLong (String key, int value) |
| void | putBool (String key, bool value) |
| void | putFloat (String key, double value) |
| void | putDouble (String key, double value) |
| void | putString (String key, String value) |
| void | remove (String key) |
| void | clear () |
Interface for key-value storage operations, allowing storage and retrieval of various data types.
Referenced from StorageManager.
Definition at line 18 of file key_value_storage.dart.
| void KeyValueStorage.clear | ( | ) |
Removes all entries from the storage.
Dart code snippet:
| bool KeyValueStorage.contains | ( | String | key | ) |
Checks whether the key exists in the storage.
| key | Key to check. |
Dart code snippet:
| bool KeyValueStorage.getBool | ( | String | key, |
| bool | defaultValue ) |
Gets a boolean value. Returns defaultValue if the key is missing or the stored type is not bool.
| key | Lookup key. |
| defaultValue | Value to return when not found or type mismatch. |
Dart code snippet:
| double KeyValueStorage.getDouble | ( | String | key, |
| double | defaultValue ) |
Gets a 64-bit floating-point value. Returns defaultValue if the key is missing or the stored type is not double.
| key | Lookup key. |
| defaultValue | Value to return when not found or type mismatch. |
Dart code snippet:
| double KeyValueStorage.getFloat | ( | String | key, |
| double | defaultValue ) |
Gets a 32-bit floating-point value. Returns defaultValue if the key is missing or the stored type is not float.
| key | Lookup key. |
| defaultValue | Value to return when not found or type mismatch. |
Dart code snippet:
| int KeyValueStorage.getInt | ( | String | key, |
| int | defaultValue ) |
Gets a 32-bit integer value. Returns defaultValue if the key is missing or the stored type is not int.
| key | Lookup key. |
| defaultValue | Value to return when not found or type mismatch. |
Dart code snippet:
| List< String > KeyValueStorage.getKeys | ( | ) |
Returns all keys currently stored.
Dart code snippet:
| int KeyValueStorage.getLong | ( | String | key, |
| int | defaultValue ) |
Gets a 64-bit integer value. Returns defaultValue if the key is missing or the stored type is not long.
| key | Lookup key. |
| defaultValue | Value to return when not found or type mismatch. |
Dart code snippet:
| String KeyValueStorage.getString | ( | String | key, |
| String | defaultValue ) |
Gets a string value. Returns defaultValue if the key is missing or the stored type is not string.
| key | Lookup key. |
| defaultValue | Value to return when not found or type mismatch. |
Dart code snippet:
| void KeyValueStorage.putBool | ( | String | key, |
| bool | value ) |
Stores a boolean value under the key, replacing any existing value.
| key | Key to set. |
| value | Value to store. |
Dart code snippet:
| void KeyValueStorage.putDouble | ( | String | key, |
| double | value ) |
Stores a 64-bit floating-point value under the key, replacing any existing value.
| key | Key to set. |
| value | Value to store. |
Dart code snippet:
| void KeyValueStorage.putFloat | ( | String | key, |
| double | value ) |
Stores a 32-bit floating-point value under the key, replacing any existing value.
| key | Key to set. |
| value | Value to store. |
Dart code snippet:
| void KeyValueStorage.putInt | ( | String | key, |
| int | value ) |
Stores a 32-bit integer value under the key, replacing any existing value.
| key | Key to set. |
| value | Value to store. |
Dart code snippet:
| void KeyValueStorage.putLong | ( | String | key, |
| int | value ) |
Stores a 64-bit integer value under the key, replacing any existing value.
| key | Key to set. |
| value | Value to store. |
Dart code snippet:
| void KeyValueStorage.putString | ( | String | key, |
| String | value ) |
Stores a string value under the key, replacing any existing value.
| key | Key to set. |
| value | Value to store. |
Dart code snippet:
| void KeyValueStorage.remove | ( | String | key | ) |
Removes a value by key. No-op if the key does not exist.
| key | Key to remove. |
Dart code snippet: