runMultiSelectPrompt<T> function

Future<List<T>?> runMultiSelectPrompt<T>(
  1. MultiSelectModel<T> model,
  2. Terminal terminal, {
  3. ProgramOptions? options,
})

Runs a MultiSelectModel and resolves to the selected items, or null if cancelled.

Implementation

Future<List<T>?> runMultiSelectPrompt<T>(
  MultiSelectModel<T> model,
  Terminal terminal, {
  ProgramOptions? options,
}) async {
  final controller = _PromptController<List<T>?>();
  final program = Program(
    _MultiSelectPromptModel<T>(model, controller),
    options: options ?? promptProgramOptions,
    terminal: terminal,
  );
  await program.run();
  return await controller.future;
}