- Notifications
You must be signed in to change notification settings - Fork1.7k
Open
Description
When the arguments received from the widget changed, we wanted to clear the existing listener for the pagingController and populate a new one. How can i do this?
@overridevoiddidUpdateWidget(convariantMyWidget oldWidget) {super.didUpdateWidget(oldWidget);if (oldWidget.path!= widget.path) { _pagingController.removePageRequestListener(_pageRequestListener!); _pageRequestListener=null; _pageRequestListener= (pageKey)async {// This is where we use viewModel. } _pagingController.addPageRequestListener(_pageRequestListener!); _pagingController.refresh(); }}
Metadata
Metadata
Assignees
Labels
No labels