'infinite loop on Dart

Is there still a bug in this code that can cause an infinite loop? Please explain if there is, Thank you

String username;
bool notValid = false;

do {
stdout.write('Masukkan nama Anda (min. 6 karakter): ');
username = stdin.readLineSync();

if (username.length < 6 ) {
notValid = true;
print('Username Anda tidak valid');
}
} while (notValid);


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source