Repository<K, T> class final

Typed facade over one Resource.

Properties

hashCode → int
The hash code for this object.
no setterinherited
resource → Resource<K, T>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

get(K id, {bool forceRefresh = false}) → Future<Snapshot<T>>
Reads id following the freshness windows (fresh / SWR / fetch / stale-if-error / stale-if-offline). Never throws for network errors: they are reported in Snapshot.error.
invalidate(K id) → Future<void>
Marks id for revalidation on the next read.
keyOf(K id) → RecordKey
mutate(K id, Mutation<T> mutation, {List<OpId> dependsOn = const []}) → Future<OpHandle>
Enqueues mutation atomically. Returns once the op is durable; the UI sees the optimistic value immediately through get/watch.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
peek(K id) → Future<Snapshot<T>>
Local-only read: never touches the network.
pin(K id, {bool pinned = true}) → Future<void>
Pins id so it is never evicted.
toString() → String
A string representation of this object.
inherited
watch(K id) → Stream<Snapshot<T>>
Reads and then follows every committed change of id (optimistic writes, acknowledgements, refreshes). Duplicate snapshots are skipped.

Operators

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