PaginatedRemoterData<T> class
Represents data fetched for PaginatedRemoterQuery
T
represents the type of data in list of pages fetched in the query
- Inheritance
-
- Object
- BaseRemoterData<
T> - PaginatedRemoterData
Constructors
-
PaginatedRemoterData({required String key, required List<
T> ? data, required List<RemoterParam?> ? pageParams, DateTime? updatedAt, Object? error, RemoterStatus? status, bool? isRefetching, int? failCount, int? prevPageFailCount, int? nextPageFailCount, bool? isFetchingPreviousPage, bool? isFetchingNextPage, bool? isPreviousPageError, bool? isNextPageError, bool? hasPreviousPage, bool? hasNextPage}) -
Represents data fetched for PaginatedRemoterQuery
T
represents the type of data in list of pages fetched in the query
Properties
-
data
→ List<
T> ? -
Represents data in list of pages
execute function returns based on pageParams on RemoterStatus.success
final
- error ↔ Object?
-
Represents error object if status is RemoterStatus.error
also can be non-null if next or previous page fetch fails
getter/setter pairinherited
- failCount → int
-
Represents how many times execute function failed while fetching this query, default 0
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasNextPage → bool
-
Indicates if query has next page
final
- hasPreviousPage → bool
-
Indicates if query has previous page
final
- isFetchingNextPage → bool
-
Represents if currently fetching next page
final
- isFetchingPreviousPage → bool
-
Represents if currently fetching previous page
final
- isNextPageError → bool
-
Represents if error occured while fetching next page
error field stores thrown error
final
- isPreviousPageError → bool
-
Represents if error occured while fetching previous page
error field stores thrown error
final
- isRefetching ↔ bool
-
True if query refetch is in progress, default false
getter/setter pairinherited
- key ↔ String
-
Unique identifier of data
getter/setter pairinherited
- nextPageFailCount → int
-
Represents how many times execute function failed while fetching next page, default 0
final
-
pageParams
→ List<
RemoterParam?> ? -
Stores parameters used to call fetch function with
final
- prevPageFailCount → int
-
Represents how many times execute function failed while fetching previous page, default 0
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status ↔ RemoterStatus
-
Represents state of data, default RemoterStatus.idle
getter/setter pairinherited
- updatedAt ↔ DateTime
-
Represents last time data is updated, default now
getter/setter pairinherited
Methods
-
copyWith(
{String? key, Nullable< List< ? data, Nullable<T> >List< ? pageParams, Nullable<RemoterParam?> >Object> ? error, Nullable<DateTime> ? updatedAt, Nullable<RemoterStatus> ? status, Nullable<bool> ? isRefetching, Nullable<bool> ? isFetchingPreviousPage, Nullable<bool> ? isFetchingNextPage, Nullable<bool> ? isPreviousPageError, Nullable<bool> ? isNextPageError, Nullable<bool> ? hasPreviousPage, Nullable<bool> ? hasNextPage, Nullable<int> ? failCount, Nullable<int> ? prevPageFailCount, Nullable<int> ? nextPageFailCount}) → PaginatedRemoterData<T> -
override
-
modifyData(
int index, T data) → List< T> ? -
Creates new copy of this.data with mutated element at
index
withdata
-
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