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

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
skip int?
The number of items to skip.
getter/setter pair
take int?
The number of items to return.
getter/setter pair
total bool
The flag to return the total number of items.
getter/setter pair

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.
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

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.