promptYesNo static method
Prompt yes/no question
Implementation
static bool promptYesNo(String question, {bool defaultValue = false}) {
final defaultText = defaultValue ? 'Y/n' : 'y/N';
stdout.write('$question [$defaultText]: ');
final input = stdin.readLineSync()?.trim().toLowerCase();
if (input == null || input.isEmpty) {
return defaultValue;
}
return input == 'y' || input == 'yes';
}