askYesNo static method
Ask a yes/no question
Implementation
static Future<bool> askYesNo(String question, {bool defaultValue = true}) async {
final defaultHint = defaultValue ? '[Y/n]' : '[y/N]';
stdout.write('$question $defaultHint: ');
final input = stdin.readLineSync()?.trim().toLowerCase();
if (input == null || input.isEmpty) {
return defaultValue;
}
return input == 'y' || input == 'yes';
}