Paginator<T> class

Efficiently paginates collections of items in an object-oriented manner.

Constructors

Paginator(Iterable<T> _items, {int itemsPerPage: 5, bool useCache: true})

Properties

canGoBack bool
Returns true if there are more items at lesser page indices than the current one.
read-only
canGoForward bool
Returns true if there are more items at greater page indices than the current one.
read-only
current PaginationResult<T>
Fetches the current page. This will be cached until back or next is called. [...]
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
index int
The current page index.
read-only
itemsPerPage int
The maximum number of items to be shown per page.
final
lastPageNumber int
Returns the greatest possible page number for this collection, given the number of itemsPerPage.
read-only
pageNumber int
The current page number. This is not the same as index. [...]
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
useCache bool
If true (default), then the results of paginations will be saved by page number. [...]
final

Methods

back() → void
Moves the paginator back one page, if possible.
goToPage(int page) → void
Attempts to go the specified page. If it fails, then it will remain on the current page. [...]
next() → void
Advances the paginator one page, if possible.
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 ==(Object other) bool
The equality operator. [...]
inherited