Reputation: 1739
I try to show/hide widget in a list depends on the condition.
All I have come up with is that:
return Row(
children: [
...isLoading ? [CircularProgressIndicator()] : []
]
);
May you know a prettier way?
Upvotes: 0
Views: 39
Reputation: 727
for one child
return Row(
children: [
if(isLoading)
CircularProgressIndicator() ,
]
);
for many child try this
return Row(
children: [
if(isLoading)
...[CircularProgressIndicator() ,CircularProgressIndicator() ] ,
]
);
Upvotes: 1