remove if body isnotempty
This commit is contained in:
parent
4f4b0b609c
commit
7441af6f13
@ -484,15 +484,13 @@ class _MyHomePageState extends State<ListItemMenu> {
|
|||||||
// Update state after getting the response
|
// Update state after getting the response
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
if (body.isNotEmpty) {
|
int counter = filteredPosts.length;
|
||||||
int counter = filteredPosts.length;
|
// If we have results, map them to Events
|
||||||
// If we have results, map them to Events
|
filteredPosts = body
|
||||||
filteredPosts = body
|
.map((e) => Events.fromJson(e as Map<String, dynamic>))
|
||||||
.map((e) => Events.fromJson(e as Map<String, dynamic>))
|
.toList();
|
||||||
.toList();
|
if (counter == filteredPosts.length) {
|
||||||
if (counter == filteredPosts.length) {
|
_fetchCount--;
|
||||||
_fetchCount--;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user