StreamFetchPolicy enum

The policy options that determine whether Cloud Firestore documents should be returned from the cache only, server only, or a combination of both over time for stream-based requests.

Inheritance

Constructors

StreamFetchPolicy()
const

Values

cacheFirst → const StreamFetchPolicy

Specifies that documents should initially be delivered on the stream from the cache if present, otherwise requested from the server. Subsequent updates are delivered whenever any of the initial documents returned change in the cache.

cacheOnly → const StreamFetchPolicy

Specifies that documents should only be delivered on the stream from changes to documents in the cache.

serverFirst → const StreamFetchPolicy

Specifies that document should be delivered on the stream from the server once, blocking on waiting for server data before returning data from the cache and then emitting continued cache updates. Helpful when trying to show the latest value first to prevent staleness and then continue with changes made to the cache.

serverOnly → const StreamFetchPolicy

Specifies that documents should only be delivered on the stream from changes to the server snapshot and never changes to those documents in the cache.

cacheAndServer → const StreamFetchPolicy

Specifies that documents should be delivered on the stream from both the cache and server whenever they have updated data.

cacheAndServerOnce → const StreamFetchPolicy

Specifies that documents should initially delivered on the stream from both the cache and server with updated data similarly to cacheAndServer, but only emits a single update from the server and then continue with changes made to the cache. Helpful when trying to show data immediately (via cache) but fetching the updated data once to prevent long-term staleness.

cacheAndServerFirst → const StreamFetchPolicy

Specifies that documents should be delivered on the stream from the server first and then subsequently whenever either the cache or server have updated data the same as cacheAndServer.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Constants

values → const List<StreamFetchPolicy>
A constant List of the values in this enum, in order of their declaration.