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,
bool forceCache = false,
}) : map = null,
minWidth = width + 16,
maxWidth = width + 16,
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,
);
});