askString static method
Ask for a string input
Implementation
static Future<String> askString(String question, {String? defaultValue}) async {
if (defaultValue != null) {
stdout.write('$question [$defaultValue]: ');
} else {
stdout.write('$question: ');
}
final input = stdin.readLineSync()?.trim();
if (input == null || input.isEmpty) {
return defaultValue ?? '';
}
return input;
}