Query<DataType, ErrorType> class

Inheritance

Constructors

Query(String key, QueryFn<DataType> queryFn, {DataType? initial, required RetryConfig retryConfig, required RefreshConfig refreshConfig, JsonConfig<DataType>? jsonConfig})

Properties

data → DataType?
no setter
dataStream Stream<DataType>
no setter
debugState QueryState<DataType, ErrorType>
A development-only way to access state outside of StateNotifier.
no setterinherited
error → ErrorType?
no setter
errorStream Stream<ErrorType>
no setter
hasData bool
no setter
hasError bool
no setter
hashCode int
The hash code for this object.
no setteroverride
hasListeners bool
If a listener has been added using addListener and hasn't been removed yet.
no setterinherited
isInactive bool
no setter
isInitial bool
no setter
isLoading bool
no setter
isRefreshing bool
no setter
jsonConfig JsonConfig<DataType>?
final
key String
final
mounted bool
Whether dispose was called or not.
no setterinherited
onError ↔ ErrorListener?
A callback for error reporting if one of the listeners added with addListener throws.
getter/setter pairinherited
refreshConfig RefreshConfig
final
retryConfig RetryConfig
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state QueryState<DataType, ErrorType>
The current "state" of this StateNotifier.
getter/setter pairinherited
stream Stream<QueryState<DataType, ErrorType>>
A broadcast stream representation of a StateNotifier.
no setterinherited

Methods

addListener(Listener<QueryState<DataType, ErrorType>> listener, {bool fireImmediately = true}) → RemoveListener
Subscribes to this object.
override
cancellableRetryOperation(FutureOr<DataType?> operation(), {required RetryConfig config, required void onSuccessful(DataType?), required void onFailed(ErrorType?)}) → CancelableOperation<void>
inherited
cast<NewDataType, NewErrorType>() Query<NewDataType, NewErrorType>
dispose() → void
Frees all the resources associated to this object.
override
fetch() Future<DataType?>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refresh() Future<DataType?>
reset() Future<void>
resolve(Widget data(DataType data), {required Widget error(ErrorType data), required Widget loading(), Widget offline()?}) Widget
resolveWith(BuildContext context, Widget data(DataType data), {required Widget error(ErrorType error)?, required Widget loading()?, Widget offline()?}) Widget
retryOperation(FutureOr<DataType?> operation(), {required RetryConfig config, required void onSuccessful(DataType?), required void onFailed(ErrorType?)}) Future<void>
inherited
setData(DataType data) → void
toString() String
A string representation of this object.
inherited
updateQueryFn(QueryFn<DataType> queryFn) → void
updateShouldNotify(QueryState<DataType, ErrorType> old, QueryState<DataType, ErrorType> current) bool
Whether to notify listeners or not when state changes
inherited

Operators

operator ==(Object other) bool
The equality operator.
override