diff --git a/lib/src/plugin/pluto_lazy_pagination.dart b/lib/src/plugin/pluto_lazy_pagination.dart index 3e25dbea2..6fd5a274a 100644 --- a/lib/src/plugin/pluto_lazy_pagination.dart +++ b/lib/src/plugin/pluto_lazy_pagination.dart @@ -180,20 +180,22 @@ class _PlutoLazyPaginationState extends State { ), ) .then((data) { - stateManager.scroll.bodyRowsVertical!.jumpTo(0); + if(mounted) { + stateManager.scroll.bodyRowsVertical!.jumpTo(0); - stateManager.refRows.clearFromOriginal(); - stateManager.insertRows(0, data.rows); + stateManager.refRows.clearFromOriginal(); + stateManager.insertRows(0, data.rows); - setState(() { - _page = page; + setState(() { + _page = page; - _totalPage = data.totalPage; + _totalPage = data.totalPage; - _isFetching = false; - }); + _isFetching = false; + }); - stateManager.setShowLoading(false); + stateManager.setShowLoading(false); + } }); }