QueryPersistence class final
Restores a QueryClient and coalesces subsequent cache writes.
Constructors
- QueryPersistence({required QueryClient client, required QueryPersister persister, String buster = '', Duration maxAge = const Duration(days: 1), Duration writeDelay = const Duration(milliseconds: 100), QuerySerializeData serializeData = _persistenceIdentity, QueryDeserializeData deserializeData = _persistenceIdentity})
-
Creates persistence for
clientthroughpersister.
Properties
- buster → String
-
Cache version required during restore.
final
- client → QueryClient
-
The client whose caches are persisted.
final
- deserializeData → QueryDeserializeData
-
Restores query data from stored values.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxAge → Duration
-
Maximum accepted snapshot age.
final
- persister → QueryPersister
-
The storage adapter.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serializeData → QueryDeserializeData
-
Converts query data into storage-safe values.
final
- writeDelay → Duration
-
Delay used to coalesce cache writes.
final
Methods
-
dispose(
) → void - Stops persistence listeners and delayed writes.
-
flush(
) → Future< void> - Cancels the write delay and waits for a current save.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
restoreAndListen(
) → Future< void> - Restores an accepted snapshot and starts listening for cache changes.
-
save(
) → Future< void> - Saves one current snapshot after any pending save.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited