PageData<T> class

Data model about the page results from any paginated API

Constructors

PageData({required List<T> data, required int count, required String? next, required String? previous})
PageData.empty()
factory
PageData.fromJson(Map<String, dynamic> json, T callBack(Map<String, dynamic> json), {bool safe = true})
If safe is true and callback throws and exception, the single element is skipped, otherwise if safe is false, the exception is re-thrown
factory
PageData.fromList(List<T> values, {bool thereAreMore = true})
factory

Properties

count int
The status code results for this page
getter/setter pair
data List<T>
The list of data returned inside this page
getter/setter pair
decodeCurrentPage int
Deduce the current page number from the next and previous page numbers
no setter
hashCode int
The hash code for this object.
no setteroverride
next String?
Error message in case of error
getter/setter pair
nextPage int?
no setter
previous String?
Has a next page?
getter/setter pair
previousPage int?
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({List<T>? data, int? count, String? next, String? previous}) PageData<T>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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