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.
read / write
total ↔ int
The total amount of items in a request.
read / write
hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

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

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited