In dart there are total 5 types of Loops.
For Loop
For....in Loop
For Each Loop
While Loop
Do.....While Loop
In this section we will see about Dart " do... while Loop " .
- The body of the loop will be executed first and then the condition is tested.
void main() {
// DO-WHILE Loop
int i = 1;
do {
if ( i % 2 == 0) {
print(i);
}
i++;
} while ( i <= 10);
}
ย