TTableHeader<T, K>.row constructor

TTableHeader<T, K>.row(
  1. String text,
  2. List<Widget> builder(
    1. T
    ), {
  3. int? flex,
  4. double? minWidth,
  5. double? maxWidth,
  6. Alignment? alignment,
  7. double spacing = 8.0,
  8. double runSpacing = 4.0,
  9. WrapCrossAlignment crossAxisAlignment = WrapCrossAlignment.center,
  10. WrapAlignment wrapAlignment = WrapAlignment.start,
  11. String? key,
  12. TFilterType? filterType,
  13. bool filterable = false,
  14. List<TFilterOperator>? filterOperators,
  15. List? filterItems,
  16. TFilterDef<T>? filterDef,
  17. double widthEstimator(
    1. T data
    )?,
  18. bool flattenOnMobile = false,
  19. String mobileKeyPrefixBuilder(
    1. String headerText,
    2. String childKey
    )?,
  20. List<TKeyValue> keyValuesBuilder(
    1. T data
    )?,
})

Creates a header for displaying multiple widgets in a horizontal row/wrap in table cells.

Implementation

TTableHeader.row(
  this.text,
  List<Widget> Function(T) builder, {
  this.flex,
  this.minWidth,
  this.maxWidth,
  this.alignment,
  double spacing = 8.0,
  double runSpacing = 4.0,
  WrapCrossAlignment crossAxisAlignment = WrapCrossAlignment.center,
  WrapAlignment wrapAlignment = WrapAlignment.start,
  this.key,
  this.filterType,
  this.filterable = false,
  this.filterOperators,
  this.filterItems,
  this.filterDef,
  this.widthEstimator,
  this.flattenOnMobile = false,
  this.mobileKeyPrefixBuilder,
  this.keyValuesBuilder,
})  : map = null,
      builder = ((ctx, item, __) {
        final isDense = TTableScope.maybeOf(ctx)?.dense ?? false;
        final widgets = builder(item.data);
        if (widgets.isEmpty) return const SizedBox.shrink();

        return Wrap(
          spacing: isDense ? spacing * 0.75 : spacing,
          runSpacing: isDense ? runSpacing * 0.75 : runSpacing,
          crossAxisAlignment: crossAxisAlignment,
          alignment: wrapAlignment,
          children: widgets,
        );
      });