QueryConfig class
Configuration options for a single query.
Constructors
- QueryConfig({Duration staleTime = const Duration(minutes: 5), Duration cacheTime = const Duration(minutes: 30), int retryCount = 3, Duration retryDelay = const Duration(seconds: 1), bool refetchOnWindowFocus = true, bool refetchOnReconnect = true, bool enabled = true})
-
Creates a new QueryConfig instance.
const
Properties
- cacheTime → Duration
-
The duration for which data remains in the cache after it's no longer actively observed.
After this time, the data is garbage collected.
final
- enabled → bool
-
Whether the query is enabled. If false, the query will not fetch data.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- refetchOnReconnect → bool
-
Whether to refetch the query when the network connection is restored.
final
- refetchOnWindowFocus → bool
-
Whether to refetch the query when the application window regains focus.
final
- retryCount → int
-
The number of times to retry a failed fetch.
final
- retryDelay → Duration
-
The base delay between retries. The actual delay will increase with each attempt.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- staleTime → Duration
-
The duration after which cached data is considered stale.
If data is stale, it will be refetched in the background on subsequent access.
final
Methods
-
copyWith(
{Duration? staleTime, Duration? cacheTime, int? retryCount, Duration? retryDelay, bool? refetchOnWindowFocus, bool? refetchOnReconnect, bool? enabled}) → QueryConfig - Creates a copy of this QueryConfig with updated values.
-
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.
override