StatelessDataTable constructor
StatelessDataTable({
- Key? key,
- Widget? header,
- List<
Widget> ? actions, - required List<
DataColumn> columns, - required List<
DataRow> rows, - int? sortColumnIndex,
- bool showCheckboxColumn = true,
- bool sortAscending = true,
- int? totalItems,
- ValueSetter<
bool?> ? onSelectAll, - int firstRowIndex = 0,
- ValueChanged<
int?> ? onPageChanged, - bool shrinkWrap = false,
- List<
Widget> ? selectedActions, - bool rowCountApproximate = false,
- int rowsPerPage = defaultRowsPerPage,
- VoidCallback? handlePrevious,
- VoidCallback? handleNext,
- List<
int> availableRowsPerPage = const <int>[defaultRowsPerPage, defaultRowsPerPage * 2, defaultRowsPerPage * 5, defaultRowsPerPage * 10], - ValueChanged<
int?> ? onRowsPerPageChanged, - DragStartBehavior dragStartBehavior = DragStartBehavior.down,
Implementation
StatelessDataTable({
Key? key,
this.header,
this.actions,
required this.columns,
required this.rows,
this.sortColumnIndex,
this.showCheckboxColumn = true,
this.sortAscending = true,
this.totalItems,
this.onSelectAll,
this.firstRowIndex = 0,
this.onPageChanged,
this.shrinkWrap = false,
this.selectedActions,
this.rowCountApproximate = false,
this.rowsPerPage = defaultRowsPerPage,
this.handlePrevious,
this.handleNext,
this.availableRowsPerPage = const <int>[defaultRowsPerPage, defaultRowsPerPage * 2, defaultRowsPerPage * 5, defaultRowsPerPage * 10],
this.onRowsPerPageChanged,
this.dragStartBehavior = DragStartBehavior.down,
}) : assert(columns.isNotEmpty),
assert(sortColumnIndex == null || (sortColumnIndex >= 0 && sortColumnIndex < columns.length)),
assert(rowsPerPage > 0),
assert(() {
if (onRowsPerPageChanged != null) {
assert(availableRowsPerPage.contains(rowsPerPage));
}
return true;
}()),
super(key: key);