chooseAnyWithTUI function

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

Enhanced multi-choice selection with TUI support

Displays a list of options with checkboxes and allows selecting multiple. Falls back to numbered list with comma-separated input if TUI is disabled. Returns the list of selected options.

Implementation

List<String> chooseAnyWithTUI(
  String message,
  List<String> choices, {
  List<String>? defaultValues,
}) {
  if (!_tuiEnabled || !_isTTY() || choices.isEmpty) {
    return _basicChooseAny(message, choices, defaultValues: defaultValues);
  }

  return tuiLogger.chooseAny(
    message,
    choices: choices,
    defaultValues: defaultValues,
  );
}