The while loop is used to execute a block of code repeatedly as long as a condition is true.

while (condition) {
  // code to be executed
}

void main() {
  int count = 0;
  while (count < 5) {
    print('Count: $count');
    count++;
  }
}