Merge pull request 'add fetchcount' (#44) from hotfix/fix-counter into main

Reviewed-on: #44
This commit is contained in:
v4l3n71n 2025-06-23 20:02:46 +00:00
commit 6641c7938c

View File

@ -469,15 +469,17 @@ class _MyHomePageState extends State<ListItemMenu> {
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<String, dynamic>))
.toList();
if (counter == filteredPosts.length) {
_fetchCount--;
}
}
});
} else {