Compare commits
2 Commits
9d35a59ba6
...
6641c7938c
Author | SHA1 | Date | |
---|---|---|---|
6641c7938c | |||
8904032265 |
@@ -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 {
|
||||
|
Reference in New Issue
Block a user