askYesNoQuestion static method
Implementation
static bool askYesNoQuestion(String title) {
log('\n$title (y/n)');
bool? result;
do {
var line = stdin.readLineSync(encoding: utf8);
final allowedValues = ['y', 'n', 'yes', 'no'];
if (allowedValues.contains(line)) {
result = line == 'y' || line == 'yes';
} else {
log('\nPlease enter y or n');
}
} while (result == null);
return result;
}