askWithOptions method

dynamic askWithOptions (
  1. String prompt,
  2. List<Option> options
)

Implementation

dynamic askWithOptions(String prompt, List<Option> options) {
  final input = _ask(prompt, options);

  try {
    return options[int.parse(input)].value;
  } catch(error) {
    return askWithOptions(prompt, options);
  }
}