chooseOneWithTUI function

String? chooseOneWithTUI(
  1. String message,
  2. List<String> choices, {
  3. String? defaultValue,
})

Enhanced single-choice selection with TUI support

Displays a list of options and allows user to select one using arrow keys. Falls back to numbered list selection if TUI is disabled. Returns the selected option or null if cancelled.

Implementation

String? chooseOneWithTUI(
  String message,
  List<String> choices, {
  String? defaultValue,
}) {
  if (!_tuiEnabled || !_isTTY() || choices.isEmpty) {
    return _basicChooseOne(message, choices, defaultValue: defaultValue);
  }

  return tuiLogger.chooseOne(
    message,
    choices: choices,
    defaultValue: defaultValue,
  );
}