TTableHeader<T, K>.image constructor
TTableHeader<T, K>.image (})
Creates a header for displaying images.
Implementation
TTableHeader.image(
this.text,
String? Function(T) map, {
this.flex,
this.alignment,
double width = 50,
double? minWidth,
double? maxWidth,
bool forceCache = false,
double Function(T data)? widthEstimator,
this.flattenOnMobile = false,
this.mobileKeyPrefixBuilder,
this.keyValuesBuilder,
}) : map = null,
key = null,
filterType = null,
filterable = false,
filterOperators = null,
filterItems = null,
filterDef = null,
widthEstimator = widthEstimator ?? ((_) => width),
minWidth = minWidth ?? (width + 36),
maxWidth = maxWidth ?? (flex != null ? null : (width + 36)),
builder = ((ctx, item, __) {
final isDense = TTableScope.maybeOf(ctx)?.dense ?? false;
final imgUrl = map(item.data);
if (imgUrl == null) return const SizedBox.shrink();
return TImage(
url: imgUrl,
size: isDense ? width * 0.8 : width,
forceCache: forceCache,
);
});