Reputation: 1
There are several Paginate DataTable widgets on my page. I want that when the button is clicked, a new item is added to the end of the list and the page switches to the last one. How can I programmatically change the page number in one of the tables? In this case, you cannot use GlobalKey to get PagibateDataTableState, because it will not be unique.
Now I managed to get PaginateDataTableState via findAncestorStateOfType from the context of the child widget, but it looks bad
Upvotes: 0
Views: 86