From 8904032265da665585d8c05c4d1f319549a4c317 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Wed, 18 Jun 2025 23:36:24 +0200 Subject: [PATCH] add fetchcount --- covas_mobile/lib/pages/ListItemMenu.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/covas_mobile/lib/pages/ListItemMenu.dart b/covas_mobile/lib/pages/ListItemMenu.dart index 4614044..f418aa0 100644 --- a/covas_mobile/lib/pages/ListItemMenu.dart +++ b/covas_mobile/lib/pages/ListItemMenu.dart @@ -469,15 +469,17 @@ class _MyHomePageState extends State { print("results fetch : ${body}"); print("fetch count : ${_fetchCount}"); // Update state after getting the response - if (body.isEmpty) { - _fetchCount--; - } + setState(() { if (body.isNotEmpty) { + int counter = filteredPosts.length; // If we have results, map them to Events filteredPosts = body .map((e) => Events.fromJson(e as Map)) .toList(); + if (counter == filteredPosts.length) { + _fetchCount--; + } } }); } else {