statusColumn<T extends Object> method
Color-coded status badge column.
Renders a rounded chip whose background is a translucent variant of
color and whose foreground reuses the same color for the label.
Implementation
TableColumn<T> statusColumn<T extends Object>({
required String title,
required String Function(T) label,
required Color Function(T) color,
double sizeFactor = .1,
String? id,
bool isMain = false,
}) {
return TableColumn<T>(
id: id,
title: Text(title),
cellBuilder: (item) {
final c = color(item);
return Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: c.withValues(alpha: 0.15),
borderRadius: BorderRadius.circular(12),
),
child: Text(
label(item),
style: TextStyle(
color: c,
fontWeight: FontWeight.w600,
fontSize: 12,
),
),
);
},
sizeFactor: sizeFactor,
isMain: isMain,
);
}