SelectModel<T> constructor
SelectModel<T> ({
- required List<
T> items, - String title = 'Select an option:',
- bool showTitle = true,
- bool showHelp = true,
- bool showPagination = true,
- int height = 10,
- int initialIndex = 0,
- String display(
- T
- SelectKeyMap? keyMap,
- SelectStyles? styles,
Creates a new select model.
Implementation
SelectModel({
required List<T> items,
this.title = 'Select an option:',
this.showTitle = true,
this.showHelp = true,
this.showPagination = true,
int height = 10,
int initialIndex = 0,
this.display,
SelectKeyMap? keyMap,
SelectStyles? styles,
}) : _items = items,
keyMap = keyMap ?? SelectKeyMap(),
styles = styles ?? SelectStyles.defaults(),
_cursor = initialIndex.clamp(0, items.isEmpty ? 0 : items.length - 1),
_height = height {
_paginator = PaginatorModel(
type: PaginationType.dots,
activeDot: '●',
inactiveDot: '○',
);
_updatePagination();
}