TTableHeader<T, K>.chip constructor

TTableHeader<T, K>.chip(
  1. String text,
  2. Object? map(
    1. T
    )?, {
  3. int? flex,
  4. double? minWidth,
  5. double? maxWidth,
  6. Alignment? alignment,
  7. Color color(
    1. T
    )?,
  8. TVariant? type,
  9. void Function()? onTap(
    1. T
    )?,
})

Creates a header for displaying chips.

Implementation

TTableHeader.chip(
  this.text,
  this.map, {
  this.flex,
  this.minWidth,
  this.maxWidth,
  this.alignment,
  Color Function(T)? color,
  TVariant? type,
  void Function()? Function(T)? onTap,
}) : builder = ((ctx, item, __) {
        final isDense = TTableScope.maybeOf(ctx)?.dense ?? false;
        return TChip(
          text: map?.call(item.data).toString(),
          color: color?.call(item.data),
          type: type,
          onTap: onTap?.call(item.data),
          padding: isDense ? const EdgeInsets.symmetric(horizontal: 6, vertical: 2) : null,
        );
      });