ReadableTable<T> constructor

const ReadableTable<T>({
  1. Key? key,
  2. ReadableTableController<T>? controller,
  3. List<ReadableColumn<T>>? columns,
  4. List<T>? rows,
  5. ReadableSelectionMode selectionMode = ReadableSelectionMode.none,
  6. bool showHeader = true,
  7. bool zebra = false,
  8. bool hoverHighlight = false,
  9. double rowMinHeight = 52,
  10. EdgeInsets cellPadding = const EdgeInsets.symmetric(horizontal: 12, vertical: 14),
  11. Widget? emptyState,
  12. bool showFilterBar = false,
  13. bool filterBarSearch = true,
  14. String filterSearchHint = 'Search…',
  15. String filterItemNoun = 'row',
  16. String filterItemNounPlural = 'rows',
  17. double filterBarGap = 10,
  18. bool showColumnFilters = false,
  19. Set<int>? initialSelectedRows,
  20. Set<ReadableCell>? initialSelectedCells,
  21. int? initialSortColumn,
  22. bool initialSortAscending = true,
  23. ValueChanged<List<T>>? onRowSelectionChanged,
  24. ValueChanged<Set<ReadableCell>>? onCellSelectionChanged,
  25. void onRowTap(
    1. T value,
    2. int index
    )?,
  26. void onSortChanged(
    1. int? column,
    2. bool ascending
    )?,
})

Implementation

const ReadableTable({
  super.key,
  this.controller,
  this.columns,
  this.rows,
  this.selectionMode = ReadableSelectionMode.none,
  this.showHeader = true,
  this.zebra = false,
  this.hoverHighlight = false,
  this.rowMinHeight = 52,
  this.cellPadding = const EdgeInsets.symmetric(horizontal: 12, vertical: 14),
  this.emptyState,
  this.showFilterBar = false,
  this.filterBarSearch = true,
  this.filterSearchHint = 'Search…',
  this.filterItemNoun = 'row',
  this.filterItemNounPlural = 'rows',
  this.filterBarGap = 10,
  this.showColumnFilters = false,
  this.initialSelectedRows,
  this.initialSelectedCells,
  this.initialSortColumn,
  this.initialSortAscending = true,
  this.onRowSelectionChanged,
  this.onCellSelectionChanged,
  this.onRowTap,
  this.onSortChanged,
}) : assert(controller != null || columns != null,
          'Provide a controller, or columns (+ rows).');