TTableHeader<T, K>.stacked constructor
TTableHeader<T, K>.stacked (
- String text,
- List<
Widget> builder(- T
- int? flex,
- double? minWidth,
- double? maxWidth,
- Alignment? alignment,
- double rowHeight = 40,
- bool showDividers = true,
- Color? dividerColor,
- EdgeInsetsGeometry contentPadding = const EdgeInsets.symmetric(horizontal: 5),
- String? key,
- double widthEstimator(
- T data
- bool flattenOnMobile = false,
- bool showInDetails = true,
- String mobileKeyPrefixBuilder()?,
Creates a header that stacks several fixed-height sub-rows inside one table row.
Use it for grouped rows (one item = one card holding several sub-rows).
Columns built with the same rowHeight line up sub-row by sub-row, so no
colspan/rowspan is needed. Use a plain column (e.g. TTableHeader.new) for the
group label cell; it stays vertically centered across the whole stack.
The cell is rendered edge to edge (fullBleedCell) and each sub-row pads its
own content by contentPadding, so dividers of neighboring stacked columns join
into one continuous line.
builder must return the same number of widgets for every stacked column
of the table.
Implementation
factory TTableHeader.stacked(
String text,
List<Widget> Function(T) builder, {
int? flex,
double? minWidth,
double? maxWidth,
Alignment? alignment,
double rowHeight = 40,
bool showDividers = true,
Color? dividerColor,
EdgeInsetsGeometry contentPadding = const EdgeInsets.symmetric(horizontal: 5),
String? key,
double Function(T data)? widthEstimator,
bool flattenOnMobile = false,
bool showInDetails = true,
String Function(String headerText, String childKey)? mobileKeyPrefixBuilder,
}) =>
_TStackedTableHeader<T, K>(
text,
builder,
flex: flex,
minWidth: minWidth,
maxWidth: maxWidth,
alignment: alignment,
rowHeight: rowHeight,
showDividers: showDividers,
dividerColor: dividerColor,
contentPadding: contentPadding,
key: key,
widthEstimator: widthEstimator,
flattenOnMobile: flattenOnMobile,
showInDetails: showInDetails,
mobileKeyPrefixBuilder: mobileKeyPrefixBuilder,
);