NetworkMode enum

How connectivity gates fetching — the networkMode option, for queries and mutations alike. Connectivity comes from the client's OnlineManager.

Default: NetworkMode.online.

A closed set of constants, so a plain enum rather than a sealed class:

networkMode: NetworkMode.online        // the default
networkMode: NetworkMode.always        // e.g. a local database
networkMode: NetworkMode.offlineFirst  // e.g. a service-worker cache
Inheritance
Available extensions

Values

online → const NetworkMode

Only fetch while online. Offline, a fetch does not start: the query stays pending (or keeps its data) with fetchStatus paused, and continues when the network comes back and a mounted client passes that on. Retries pause the same way.

always → const NetworkMode

Ignore connectivity entirely: always fetch, never pause for the network. For work that does not need one, such as reading a local store.

offlineFirst → const NetworkMode

Try the first attempt even when offline, then pause any retry until the network comes back. For a query function that may be answered by a cache of its own.

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<NetworkMode>
A constant List of the values in this enum, in order of their declaration.