TableModel constructor
TableModel({
- List<
Column> ? columns, - List<
Row> ? rows, - int? height,
- int? width,
- bool focused = false,
- TableKeyMap? keyMap,
- TableStyles? styles,
- HelpModel? help,
Creates a new table model.
Implementation
TableModel({
List<Column>? columns,
List<Row>? rows,
int? height,
int? width,
bool focused = false,
TableKeyMap? keyMap,
TableStyles? styles,
HelpModel? help,
}) : _columns = columns ?? [],
_rows = rows ?? [],
_cursor = 0,
_focused = focused,
keyMap = keyMap ?? TableKeyMap(),
styles = styles ?? TableStyles.defaults(),
help = help ?? HelpModel() {
_viewport = ViewportModel(width: 0, height: 20);
if (height != null) setHeight(height);
if (width != null) setWidth(width);
updateViewport();
}