PaginatorController class

Allows to externally control PaginatedDataTable2 state and trigger actions such as changing page number or size. Instatiate an object, keep it somewhere (e.g. parent widgets state or static field/top level variable), pass it to PaginatedDataTable2.controller via constructor and you're ready to go. Please note that there're a few properties that allow to fetch internal state value's (such as rows per page), those values can't be fetched until the controller is attached - this happens during the first call to the build() method of PaginatedDataTable2. The controller extends ChangeNotifier in order to let consumers know if there're changes to PaginatedDataTable2 state. E.g. you can hide standard paginator of PaginatedDataTable2 and simplement your own paginator as a StatefullWidget, subsribe to controller in order to update the paginator.

Inheritance

Constructors

PaginatorController()

Properties

currentRowIndex int
Returns the index of the first (topmost) row displayed currently displayed in PaginatedDataTable2. Throws if no table is attached to the controller
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isAttached bool
The controllor is attched to PaginatedDataTable2 state upon the first build. Until data from internal stare is not available
no setter
rowCount int
Returns number of rows displayed in the PaginatedDataTable2. Throws if no table is attached to the controller
no setter
rowsPerPage int
Returns number of rows displayed in single page of the PaginatedDataTable2. Throws if no table is attached to the controller
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
goToFirstPage() → void
Fast forward to the very first page/row
goToLastPage() → void
Fast forward to the very last page/row
goToNextPage() → void
Show rows from the next page
goToPageWithRow(int rowIndex) → void
Switches to the page where the given row is present. The row can be in the middle of the page, pages are aligned to page size. E.g. with page size 5 going to index 6 (rows #7) will set page starting index at 5 (#6)
goToPreviousPage() → void
Show rows from the previous page
goToRow(int rowIndex) → void
Switch the page so that he given row is displayed at the top. I.e. it is possible to have pages start at arbitrary rows, not at the boundaries of pages as determined by page size.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
setRowsPerPage(int rowsPerPage) → void
Сhange page size and set the number of rows in a single page
toString() String
A string representation of this object.
inherited

Operators

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