StatelessDataTable constructor

StatelessDataTable({
  1. Key? key,
  2. Widget? header,
  3. List<Widget>? actions,
  4. required List<DataColumn> columns,
  5. required List<DataRow> rows,
  6. int? sortColumnIndex,
  7. bool showCheckboxColumn = true,
  8. bool sortAscending = true,
  9. int? totalItems,
  10. ValueSetter<bool?>? onSelectAll,
  11. int firstRowIndex = 0,
  12. ValueChanged<int?>? onPageChanged,
  13. bool shrinkWrap = false,
  14. List<Widget>? selectedActions,
  15. bool rowCountApproximate = false,
  16. int rowsPerPage = defaultRowsPerPage,
  17. VoidCallback? handlePrevious,
  18. VoidCallback? handleNext,
  19. List<int> availableRowsPerPage = const <int>[defaultRowsPerPage, defaultRowsPerPage * 2, defaultRowsPerPage * 5, defaultRowsPerPage * 10],
  20. ValueChanged<int?>? onRowsPerPageChanged,
  21. 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);