prompt function
Prompts the user for text input.
Implementation
String prompt(
String message, {
String? defaultValue,
String? validatorErrorMessage,
}) {
return Input.withTheme(
theme: inputTheme,
prompt: message,
validator: (input) {
if (input.isEmpty) {
throw ValidationError(validatorErrorMessage ?? 'Input cannot be empty');
}
return true;
},
defaultValue: defaultValue,
).interact();
}