input method

Future<String> input(
  1. String message, {
  2. String? defaultValue,
})

Input Request Guidelines

Prompts the user for a string. Accepts an optional defaultValue to specify what happens when the user simply presses Enter. Returns the string the user entered / accepted.

Format:

<message prompt>:

Throws UserInputRequiredException in --non-interactive mode.

Implementation

Future<String> input(String message, {String? defaultValue}) async {
  if (configuration?.nonInteractive == true) {
    throw UserInputRequiredException.input(message);
  }

  return promptInput(message, defaultValue: defaultValue);
}