NyStorage class

Base class to help manage local storage

Constructors

NyStorage()

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent 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 Methods

addToCollection<T>(String key, {required dynamic item, bool allowDuplicates = true, Map<Type, dynamic>? modelDecoders}) Future
Add a newItem to the collection using a key.
clear(String key) Future
Sets the key to null.
delete(String key, {bool andFromBackpack = false}) Future
Deletes associated value for the given key.
deleteAll({bool andFromBackpack = false}) Future
Deletes all keys with associated values.
deleteCollection(String key, {bool andFromBackpack = false}) Future
Deletes a collection from the given key.
deleteFromCollection<T>(int index, {required String key}) Future
Delete an item of a collection using a index and the collection key.
deleteFromCollectionWhere<T>(bool where(dynamic value), {required String key}) Future
Delete item(s) from a collection using a where query.
deleteValueFromCollection<T>(String key, {dynamic value}) Future
Delete a value from a collection using a key and the value you want to remove.
isCollectionEmpty(String key) Future<bool>
Checks if a collection is empty
manager() → FlutterSecureStorage
read<T>(String key, {dynamic defaultValue, Map<Type, dynamic>? modelDecoders}) Future
Read a value from the local storage
readAll() Future<Map<String, String>>
Decrypts and returns all keys with associated values.
readCollection<T>(String key, {Map<Type, dynamic>? modelDecoders}) Future<List<T>>
Read the collection values using a key.
readJson<T>(String key, {dynamic defaultValue}) Future
Read a JSON value from the local storage
saveCollection<T>(String key, List collection) Future
Save a list of objects to a collection using a key.
store(String key, dynamic object, {bool inBackpack = false}) Future
Saves an object to local storage.
storeJson(String key, dynamic object, {bool inBackpack = false}) Future
Saves a JSON object to local storage.
syncToBackpack({bool overwrite = false}) Future
Sync all the keys stored to the Backpack instance.
updateCollectionByIndex<T>(int index, T object(T item), {required String key}) Future<bool>
Update a value in the local storage by index.
updateCollectionWhere<T>(bool where(dynamic value), {required String key, required T update(dynamic value)}) Future
Update item(s) in a collection using a where query.