SunnyStore<V extends Entity> class
abstract
Constructors
-
SunnyStore(Repository<V> repository, MSchemaRef type, IAuthState loginState)
-
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
-