Reputation: 153
I have the following loop:
do {
await future;
} while (condition);
Is await
in do while
loops permitted?
Upvotes: 1
Views: 596
Reputation: 15751
Yes for sure, that's an example
void test()async{
int x =0;
do {
await Future.delayed(Duration(milliseconds:50));
print(x);
x++;
} while (x<5);
}
Upvotes: 2