DataPage<T> class

Data transfer object that is used to pass results of paginated queries. It contains items of retrieved page and optional total number of items.

Most often this object type is used to send responses to paginated queries. Pagination parameters are defined by PagingParams object. The skip parameter in the PagingParams there means how many items to skip. The takes parameter sets number of items to return in the page. And the optional total parameter tells to return total number of items in the query.

Remember: not all implementations support the total parameter because its generation may lead to severe performance implications.

See PagingParams

Example

page = myDataClient.getDataByFilter( '123', FilterParams.fromTuples('completed': true), NewPagingParams(0, 100, true) ); for (item in page.Data) { print(item); }

Constructors

DataPage(List<T> data, int total)
Creates a new instance of data page and assigns its values.
DataPage.fromJson(Map<String, dynamic> json, Function fromJson)
Creates a new instance of data page and assigns its values.
factory

Properties

data List<T>
The items of the retrieved page.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
total int
The total amount of items in a request.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Returned JSON Map object from values of this object
toString() String
A string representation of this object.
inherited

Operators

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