SunnyStore<V extends Entity> class abstract

Mixed in types
  • LoggingMixin

Constructors

SunnyStore(Repository<V> repository, MSchemaRef type, IAuthState loginState)

Properties

changes Stream<MapDiffs<MKey?, Record<V>>>
no setter
clearOnLogout bool
no setter
entryStream → ValueStream<Map<MKey?, Record<V>>>
no setter
equality → DiffEquality
final
hashCode int
The hash code for this object.
no setterinherited
isDisabled bool
Allows to temporarily disable, for example until the user logs in
getter/setter pair
isLoading bool
no setter
isUserStore bool
Whether or not this store requires user credentials to operate
no setter
listOnLogin bool
no setter
log → Logger
no setterinherited
loggerName String
no setteroverride
name String
no setter
nextReload Future<List<Record<V>>>
no setter
repository → Repository<V>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type → MSchemaRef
Name of the store
final
values List<Record<V>>
no setter
valuesStream Stream<List<Record<V>>>
no setter

Methods

afterCreate(V saved) FutureOr
Runs only after creation
afterDelete(MKey? id) FutureOr
afterSave(V saved) FutureOr
Runs after update or creation
afterUpdate(V saved) FutureOr
Runs only on update
applyChanges<R>(FutureOr<R> build(MapDiffs<MKey, Record<V>> changes), {Map<MKey, Record<V>>? replacement}) FutureOr<R>
beforeDelete(V toDelete) FutureOr
beforeSave(V toSave) FutureOr
checked<R>(R fn()) FutureOr<R>
Executes a function if the full data set is loaded, otherwise, returns a future
clear() Future
containsKey(MKey key) bool
create(V input) Future<V>
createWith(FutureOr modification(V input)) Future<V>
delete(V input) Future<bool>
dispose() Future
inherited
doShutdown() Future
inherited
exec<R>(R block()) → R?
inherited
exists(MKey key) FutureOr<bool>
Whether the record exists = makes sure the data set is loaded first.
fetchAll({double? offset, double? limit}) Future<List<Record<V>>>
get(MKey? key, [V? value]) Record<V>
Returns the value associated with a key in a map -- this entity is designed to track any changes to the key from which it originated.
getOrPut(MKey id, [V? value]) Record<V>
isShuttingDown() bool
inherited
list({bool? forceRefresh, double? offset, double? limit}) FutureOr<List<Record<V>>>
Lists the available data for this store. If subsequent calls are made, they will resolve to the same future.
load(MKey key) FutureOr<V?>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onLogin(AsyncOrCallback onLogin) → void
inherited
onLogout(AsyncOrCallback onLogout) → void
inherited
onReload({bool includeCurrentState = true}) Stream<List<Record<V>>>
onShutdown(_AsyncCallback callback) → void
inherited
onStartup(_AsyncCallback callback) → void
inherited
put(MKey id, void modification(V _in), {bool ignoreNotLoaded = false}) FutureOr<V?>
Updates the internal map without triggering any persistence. It's possible that other entities that are observing this store will update.
putRecord(MKey id, V data) → void
registerDisposer(FutureOr dispose()) → void
inherited
registerLoginHooks(IAuthState state) → void
inherited
reload(MKey id) Future<V?>
removeDisposer(FutureOr dispose()) → void
inherited
removeRecord(MKey id) → void
resetCompleteFlag() → void
save(V input) Future<V>
saveAll(Iterable<MKey> keys, FutureOr modification(MKey key, V input)) Future
saveWith(MKey? key, FutureOr modification(V input)) Future<V>
takeFrom(V _source, V _target) → void
toString() String
A string representation of this object.
inherited
updateAllItems(Iterable<V> data) Future

Operators

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