groupCell method
Widget
groupCell({
- required TodayTableCell cell,
- required bool isCollapsed,
- bool headerCell = false,
- double? width,
Implementation
Widget groupCell({
required TodayTableCell cell,
required bool isCollapsed,
bool headerCell = false,
double? width,
}) {
return Container(
color: isCollapsed ? TodayColor.bgBaseHover.color : Colors.transparent,
alignment: cell.cellAlignment,
width: width,
height: 56,
padding: headerCell
? EdgeInsets.symmetric(
horizontal: TodaySpacing.tdsSpace2.spacing,
)
: getPadding(
toLeft: cell.toLeft,
type: cell.type,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: cell.align == TextAlign.left ? CrossAxisAlignment.start : CrossAxisAlignment.end,
children: [
MaxWidthBox(
maxWidth: cell.maxWidth,
child: Row(
mainAxisAlignment: cell.align == TextAlign.left ? MainAxisAlignment.start : MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
if (cell.type == TodayTableCellType.custom && cell.customWidget != null) ...[
cell.customWidget!
] else ...[
if (headerCell) ...[
Transform.rotate(
angle: isCollapsed ? math.pi / 2 : 0,
child: TodayIcon(
TodaySvgIcon.chevronRightSmall,
color: TodayColor.iconFaint.color,
),
),
SizedBox(width: TodaySpacing.tdsSpace2.spacing),
],
Flexible(
child: TodayText(
cell.textContent ?? '',
rawColor: cell.textColor.color,
style: headerCell ? TodayTextStyle.tdsFontRegularHeavy : TodayTextStyle.tdsFontRegularPlus,
overflow: TextOverflow.ellipsis,
textAlign: cell.align,
),
),
if (headerCell) ...[
SizedBox(width: TodaySpacing.tdsSpace2.spacing),
TodayBadge(
label: '${children.length}',
),
],
],
],
),
),
],
),
);
}