build method

Implementation

SelectableListPrompt<T> build() {
  final prompt = SelectableListPrompt<T>(
    title: _title,
    items: _items,
    theme: _theme,
    multiSelect: _multiSelect,
    maxVisible: _maxVisible,
    initialSelection: _initialSelection,
    reservedLines: _reservedLines,
  );

  KeyBindings? combined = _extraBindings;
  if (_wantSelectAll) {
    final selectAll = KeyBindings.letter(
      char: 'A',
      onPress: () => prompt.selection.toggleAll(prompt.items.length),
      hintDescription: _selectAllHint,
    );
    combined = combined != null ? combined + selectAll : selectAll;
  }
  prompt._pendingExtraBindings = combined;

  return prompt;
}