TDataTable<T, K> constructor

const TDataTable<T, K>({
  1. Key? key,
  2. required List<TTableHeader<T, K>> headers,
  3. TTableTheme? theme,
  4. List<T>? items,
  5. int? itemsPerPage,
  6. String? search,
  7. int? searchDelay,
  8. TLoadListener<T>? onLoad,
  9. ItemKeyAccessor<T, K>? itemKey,
  10. TListController<T, K>? controller,
  11. TListExpandedBuilder<T, K>? expandedBuilder,
  12. int paginationTotalVisible = 7,
  13. List<int> itemsPerPageOptions = const [5, 10, 15, 25, 50],
  14. TGridMode? grid,
  15. TGridDelegateBuilder? gridDelegate,
  16. bool? shrinkWrap,
  17. TListHeaderBuilder? headerBuilder,
  18. TListFooterBuilder? footerBuilder,
  19. bool? infiniteScroll,
  20. bool? headerSticky,
  21. bool? footerSticky,
  22. Widget rowBuilder(
    1. BuildContext ctx,
    2. TListItem<T, K> item,
    3. int index,
    4. Widget row,
    )?,
  23. Color? rowColorBuilder(
    1. TListItem<T, K> item,
    2. int index
    )?,
})

Creates a data table component.

Implementation

const TDataTable({
  super.key,
  required this.headers,
  this.theme,
  //List
  this.items,
  this.itemsPerPage,
  this.search,
  this.searchDelay,
  this.onLoad,
  this.itemKey,
  this.controller,
  //Expandable
  this.expandedBuilder,
  //DataTable
  this.paginationTotalVisible = 7,
  this.itemsPerPageOptions = const [5, 10, 15, 25, 50],
  // Theme overrides
  this.grid,
  this.gridDelegate,
  this.shrinkWrap,
  this.headerBuilder,
  this.footerBuilder,
  this.infiniteScroll,
  this.headerSticky,
  this.footerSticky,
  this.rowBuilder,
  this.rowColorBuilder,
}) : assert(
        theme == null ||
            (grid == null &&
                gridDelegate == null &&
                shrinkWrap == null &&
                headerBuilder == null &&
                footerBuilder == null &&
                infiniteScroll == null &&
                headerSticky == null &&
                footerSticky == null),
        'Cannot provide both theme and individual theme properties.',
      );