From 030f9f4d1ac0ab5b469dbaebb20310e6a94b921f Mon Sep 17 00:00:00 2001 From: Jan Blasko Date: Wed, 12 May 2021 10:03:09 +0200 Subject: [PATCH] fix: #228 --- lib/components/PullToRefreshList.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/components/PullToRefreshList.dart b/lib/components/PullToRefreshList.dart index b63dd60..0deb08e 100644 --- a/lib/components/PullToRefreshList.dart +++ b/lib/components/PullToRefreshList.dart @@ -191,6 +191,12 @@ class _PullToRefreshListState extends State { loadData({bool append = false}) async { setState(() => _isLoading = true); + if (!append) { + // Not using setState on purpose -> we don't want to rebuild the widget tree, it's not needed. + // TODO: See if this affects performance and if we can do it on other places too. + _lastId = null; + } + // If we try to append the data but the last ID // from where we try to load the posts is same as the ID of // last item ID loaded previously.