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.