QueryState<T> class
Represents the state of a query.
- Implementers
Constructors
- QueryState({QueryStatus status = QueryStatus.initial, T? data, dynamic error, DateTime? dataUpdatedAt, DateTime? errorUpdatedAt, bool isFetching = false})
-
Creates a new query state.
const
Properties
- data → T?
-
The data returned by the query.
final
- dataUpdatedAt → DateTime?
-
The timestamp when the data was last updated.
final
- error → dynamic
-
The error returned by the query, if any.
final
- errorUpdatedAt → DateTime?
-
The timestamp when the error was last updated.
final
- hasData → bool
-
Whether the query has data.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isError → bool
-
Whether the query resulted in an error.
no setter
- isFetching → bool
-
Whether the query is currently fetching data.
final
- isInitial → bool
-
Whether the query is in the initial state.
no setter
- isLoading → bool
-
Whether the query is currently loading (fetching and has no data).
no setter
- isSuccess → bool
-
Whether the query was successful.
no setter
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → QueryStatus
-
The current status of the query.
final
- stringify → bool?
-
If set to
true, thetoStringmethod will be overridden to output this instance'sprops.no setterinherited
Methods
-
copyWith(
{QueryStatus? status, T? data, dynamic error, DateTime? dataUpdatedAt, DateTime? errorUpdatedAt, bool? isFetching}) → QueryState< T> - Creates a copy of the query state with the given fields replaced with the new 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.
inherited