tableRightPortionHeaderBuilder function
Widget
tableRightPortionHeaderBuilder(
- List<
TableHeaderModel> rightTableHeader, - double headerHeight,
- bool isSubHeadersListEmpty, {
- double textSize = 12,
Implementation
Widget tableRightPortionHeaderBuilder(List<TableHeaderModel> rightTableHeader,
double headerHeight, bool isSubHeadersListEmpty,
{double textSize = 12}) {
return Row(
children: [
...rightTableHeader.map((e) {
if (isSubHeadersListEmpty) {
return Container(
height: headerHeight,
width: e.totalWidth!,
alignment: Alignment.center,
decoration: BoxDecoration(
color: ReportTableUtils.headerColor,
border: Border(
top: BorderSide(
color: ReportTableUtils.headerCellBorderColor,
width: ReportTableUtils.cellBorderSize),
right: BorderSide(
color: ReportTableUtils.headerCellBorderColor,
width: ReportTableUtils.cellBorderSize),
left: BorderSide(
color: ReportTableUtils.headerCellBorderColor,
width: ReportTableUtils.cellBorderSize),
bottom: BorderSide(
color: ReportTableUtils.headerCellBorderColor,
width: ReportTableUtils.cellBorderSize)),
),
child: Text(
e.title ?? "No value",
style: TextStyle(
fontWeight: FontWeight.bold,
color: ReportTableUtils.headerTextColor,
fontSize: ReportTableUtils.getHeaderSize(textSize)),
),
);
} else {
if (!e.hasSubHeaders) {
return Container(
height: headerHeight + ReportTableUtils.subHeadersHeight,
width: e.totalWidth!,
alignment: Alignment.center,
decoration: BoxDecoration(
color: ReportTableUtils.headerColor,
border: Border.all(
color: ReportTableUtils.headerCellBorderColor,
width: ReportTableUtils.cellBorderSize)),
child: Text(
e.title ?? "No value",
style: TextStyle(
fontWeight: FontWeight.bold,
color: ReportTableUtils.headerTextColor,
fontSize: ReportTableUtils.getHeaderSize(textSize),
),
),
);
} else {
return Column(
children: [
Container(
height: headerHeight,
width: e.totalWidth!,
alignment: Alignment.center,
decoration: BoxDecoration(
color: ReportTableUtils.headerColor,
border: Border.all(
color: ReportTableUtils.headerCellBorderColor,
width: ReportTableUtils.cellBorderSize)),
child: Text(
e.title ?? "No value",
style: TextStyle(
fontWeight: FontWeight.bold,
color: ReportTableUtils.headerTextColor,
fontSize: ReportTableUtils.getHeaderSize(textSize),
),
),
),
tableSubHeaders(
e.subHeaders!, e.width!, ReportTableUtils.subHeadersHeight, textSize: textSize),
],
);
}
}
}),
],
);
}