PagingParams class

Data transfer object to pass paging parameters for queries.

The page is defined by two parameters:

  • the skip parameter defines number of items to skip.
  • the take parameter sets how many items to return in a page.
  • additionally, 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.

Example

var filter = FilterParams.fromTuples(['type', 'Type1']);
var paging =  PagingParams(0, 100);

myDataClient.getDataByFilter(filter, paging, (err, page) {...});

Constructors

PagingParams([dynamic skip dynamic take dynamic total ])
Creates a new instance and sets its values. [...]
PagingParams.fromJson(Map<String, dynamic> json)
Creates a new instance from json. [...]
factory

Properties

skip ↔ int
The number of items to skip.
read / write
take ↔ int
The number of items to return.
read / write
total ↔ bool
The flag to return the total number of items.
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

fromJson(Map<String, dynamic> json) → void
Initialize this object from JSON Map object
getSkip(int minSkip) → int
Gets the number of items to skip. [...]
getTake(int maxTake) → int
Gets the number of items to return in a page. [...]
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

Static Methods

fromMap(dynamic map) PagingParams
Creates a new PagingParams and sets it parameters from the specified map [...]
fromTuples(List tuples) PagingParams
Creates a new PagingParams from a list of key-value pairs called tuples. [...]
fromValue(dynamic value) PagingParams
Converts specified value into PagingParams. [...]