DataFetchStrategy enum

Strategy for choosing between the local and remote data sources when fetching data via DatumManager.fetch / DatumManager.fetchById.

This removes the repetitive "try local, then fall back to remote" boilerplate that offline-first apps otherwise hand-write. See issue #17.

Inheritance
Available extensions

Values

localOnly → const DataFetchStrategy

Query the local adapter only (never touches the network).

remoteOnly → const DataFetchStrategy

Query the remote adapter only.

localFirst → const DataFetchStrategy

Try the local adapter first; if it returns no results, fetch from the remote adapter. Optionally persist the remote results locally.

Best for offline-first reads where cached data is preferred.

remoteFirst → const DataFetchStrategy

Try the remote adapter first; if it fails (e.g. offline / error), fall back to the local adapter.

Best for "fresh when possible, cached when not" reads.

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