Dart: can i make a recursion end after meeting a condition

Don't make this recursive. Use a while loop!

void main() {
  print('what is your name bro:');
  var name = stdin.readLineSync()!;

  while (name.isEmpty) {
    print('Name can\'t be empty \n\nWhat is your name bro:');
    name = stdin.readLineSync()!;
  }
  print('How are you $name');
}