FetchPolicy enum

How a scope combines the cache and the network.

Independent of maxAge: a stale-while-revalidate window applies on top of any policy (see QueryScope.maxAge).

Inheritance
Available extensions

Values

cacheFirst → const FetchPolicy

Read from the cache; fetch only what is missing. The default.

cacheAndNetwork → const FetchPolicy

Read from the cache and refetch the whole selection in the background on the scope's first run (a screen opening), so it shows cached data at once and fresh data as soon as it lands. Later rebuilds behave like cacheFirst.

networkOnly → const FetchPolicy

Ignore the cache until this scope's own request has landed: the first runs read skeletons and everything selected is fetched, even if cached. The response is written to the shared cache as usual, and from then on the scope reads like cacheFirst.

Properties

hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
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<FetchPolicy>
A constant List of the values in this enum, in order of their declaration.