ZenQueryConfig<T> class

Configuration for ZenQuery

Annotations

Constructors

ZenQueryConfig({Duration? staleTime = const Duration(seconds: 30), Duration? cacheTime = const Duration(minutes: 5), bool refetchOnMount = true, bool refetchOnFocus = false, bool refetchOnReconnect = true, Duration? refetchInterval, bool enableBackgroundRefetch = false, int retryCount = 3, Duration retryDelay = const Duration(seconds: 1), bool exponentialBackoff = true, bool persist = false, T fromJson(Map<String, dynamic> json)?, Map<String, dynamic> toJson(T data)?, ZenStorage? storage, T? placeholderData})
const

Properties

cacheTime Duration?
How long inactive data remains in cache
final
enableBackgroundRefetch bool
Whether to enable background refetching
final
exponentialBackoff bool
Whether to use exponential backoff for retries
final
fromJson → T Function(Map<String, dynamic> json)?
Function to convert JSON to data (for hydration)
final
hashCode int
The hash code for this object.
no setterinherited
persist bool
Whether to persist this query's data
final
placeholderData → T?
Placeholder data to show while the query is loading. This does not persist to cache.
final
refetchInterval Duration?
Interval for background refetching (null = disabled)
final
refetchOnFocus bool
Whether to refetch when window gains focus
final
refetchOnMount bool
Whether to refetch when component mounts
final
refetchOnReconnect bool
Whether to refetch when network reconnects
final
retryCount int
Number of retry attempts
final
retryDelay Duration
Delay between retries
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
staleTime Duration?
How long data remains fresh
final
storage ZenStorage?
Custom storage implementation (defaults to global storage if null)
final
toJson Map<String, dynamic> Function(T data)?
Function to convert data to JSON (for persistence)
final

Methods

cast<R>() ZenQueryConfig<R>
Cast configuration to a new type
merge(ZenQueryConfig<T>? other) ZenQueryConfig<T>
Merge with another config
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

defaults → const ZenQueryConfig
Default configuration