ModDataTable<T> constructor

const ModDataTable<T>({
  1. Key? key,
  2. required List<ModDataHeader> headers,
  3. required List<T> data,
  4. required DataTableSource source,
  5. BorderStyle borderStyle = BorderStyle.none,
  6. required int rowsPerPage,
  7. Color? oddRowColor,
  8. Color? evenRowColor,
  9. Color? headerColor,
  10. String paginationText = 'of',
  11. String rowsPerPageText = 'Rows per page',
  12. required dynamic onPageChanged(
    1. int page
    ),
  13. dynamic onSort(
    1. String field,
    2. SortDirection direction
    )?,
  14. required int totalRecords,
  15. required int currentPage,
  16. Color? paginationBackgroundColor,
  17. dynamic onRowsPerPageChanged(
    1. int rowsPerPage
    )?,
  18. List<int> availableRowsPerPage = const [5, 10, 15, 20, 50, 100, 200],
  19. double? paginationBorderRadius = 5,
  20. String? currentSortField,
  21. SortDirection currentSortDirection = SortDirection.none,
  22. double rowHeight = 35.0,
})

Implementation

const ModDataTable({
  super.key,
  required this.headers,
  required this.data,
  required this.source,
  this.borderStyle = BorderStyle.none,
  required this.rowsPerPage,
  this.oddRowColor,
  this.evenRowColor,
  this.headerColor,
  this.paginationText = 'of',
  this.rowsPerPageText = 'Rows per page',
  required this.onPageChanged,
  this.onSort,
  required this.totalRecords,
  required this.currentPage,
  this.paginationBackgroundColor,
  this.onRowsPerPageChanged,
  this.availableRowsPerPage = const [5, 10, 15, 20, 50, 100, 200],
  this.paginationBorderRadius = 5,
  this.currentSortField,
  this.currentSortDirection = SortDirection.none,
  this.rowHeight = 35.0,
});