UserTokenRepoBase<TKey, T extends UserTokenBag<TKey>> class abstract

Constructors

UserTokenRepoBase()

Properties

boxName String
The name of the box.
no setter
dataBox → Box<T>
The hive box storing the data
no setterinherited
dataStream Stream<Map<TKey, T>>
Notifies the user when any write operations occur.
no setterinherited
firstOrNull MapEntry<TKey, T>?
Gets the first (key,value) stored in the box
no setterinherited
firstOrNullKey → TKey?
get the first key, or null if the box is empty
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
keys Iterable<TKey>
All the keys in the box.
no setterinherited
keySet Set<TKey>
get the existing keys as a Set of unique values
no setterinherited
keySetStream Stream<Set<TKey>>
a stream that tracks keySet when it changes
no setterinherited
keyStream Stream<Iterable<TKey>>
a stream that tracks keys when it changes
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
valuesStream Stream<Iterable<T>>
Notifies the user when any write operations occur.
no setterinherited

Methods

assignAll(Map<TKey, T> newValues) Future<void>
Clears the box then sets the keys and values provided in newValues.
inherited
clear() Future<void>
Deletes all the data in the box.
inherited
dataStreamFor(Iterable<TKey> keys) Stream<Map<TKey, T>>
Creates a stream that listens for specific keys
inherited
deleteKeys(Iterable<TKey?> keys) Future<void>
Deletes the keys provided in keys.
inherited
dispose() Future<void>
Closes the box.
extraValidation(TKey userId, T bag) Future<bool>
override this if you want to do extra validation on the token bag after checking its expiration date
firstEntryStream([Duration debounceDuration = const Duration(milliseconds: 200)]) Stream<MapEntry<TKey, T>?>
Stream that emits firstOrNull on every change for the box, with an optional debounce
inherited
getAllValues() Map<TKey, T>
Gets all the values stored in the box
inherited
getValueById(TKey? key, {T? defaultValue}) → T?
Gets the value based on the key
inherited
init() Future<void>
Initializes the repository.
inherited
initAuthLogic() Future<bool?>
true if auth successful, false if not, null if no user exists
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
put(TKey key, T newValue) Future<void>
Updates the value at the given key to newValue.
inherited
putAll(Map<TKey, T> newValues) Future<void>
Sets the keys and values provided in newValues.
inherited
putAllAndUpdateExisting(Map<TKey, T> newValues, void mutateExisting(TKey key, T mutateMe, T newValueReadOnly)) Future<void>
Same as putAll, but instead of removing old objects, changes (mutates) their values to new values
inherited
putAllAndUpdateExistingMapped<TMapped>(Map<TKey, TMapped> newValues, T mutateExisting(TKey key, T? mutateMe, TMapped newValue)) Future<void>
Same as putAllAndUpdateExisting but mutateExisting can receive a null existing value
inherited
putAndUpdateExisting(TKey key, T newValue, void mutateExisting(TKey key, T? mutateMe, T newValueReadOnly)) Future<void>
Same as put, but instead of removing old object, changes (mutates) its values to newValue
inherited
registerTokenBag(TKey userId, T tokenBag) Future<void>
requestNewTokenBag(T oldBag) Future<T>
toString() String
A string representation of this object.
inherited
watch({TKey? key}) Stream<BoxEvent>
watch the dataBox for changes to a specific key, use dataStreamFor instead
inherited

Operators

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