TTable<T, K> constructor

const TTable<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. TControllerReadyListener<T, K>? onControllerReady,
  12. TTableDetails<T, K>? details,
  13. bool editable = false,
  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. bool? dense,
  23. Widget rowBuilder(
    1. BuildContext ctx,
    2. TListItem<T, K> item,
    3. int index,
    4. Widget row,
    )?,
  24. Color? rowColorBuilder(
    1. TListItem<T, K> item,
    2. int index
    )?,
  25. WidgetBuilder? beforeItemsBuilder,
})

Creates a data table.

Implementation

const TTable({
  super.key,
  required this.headers,
  this.theme,
  //List
  this.items,
  this.itemsPerPage,
  this.search,
  this.searchDelay,
  this.onLoad,
  this.itemKey,
  this.controller,
  this.onControllerReady,
  //Details
  this.details,
  this.editable = false,
  // Theme overrides
  this.grid,
  this.gridDelegate,
  this.shrinkWrap,
  this.headerBuilder,
  this.footerBuilder,
  this.infiniteScroll,
  this.headerSticky,
  this.footerSticky,
  this.dense,
  this.rowBuilder,
  this.rowColorBuilder,
  this.beforeItemsBuilder,
}) : assert(
        theme == null ||
            (grid == null &&
                gridDelegate == null &&
                shrinkWrap == null &&
                headerBuilder == null &&
                footerBuilder == null &&
                infiniteScroll == null &&
                headerSticky == null &&
                footerSticky == null &&
                dense == null),
        'Cannot provide both theme and individual theme properties.',
      );