add table view

This commit is contained in:
ashrafzarkanisala
2024-08-24 14:03:13 +03:00
parent e576fb3b47
commit 982954be42
4 changed files with 95 additions and 34 deletions

View File

@ -75,8 +75,7 @@ class _DynamicTableState extends State<DynamicTable> {
BoxDecoration(color: Colors.grey[200]),
child: Row(
children: [
if (widget.withCheckBox)
_buildSelectAllCheckbox(),
if (widget.withCheckBox) _buildSelectAllCheckbox(),
...widget.headers
.map((header) => _buildTableHeaderCell(header))
.toList(),
@ -93,10 +92,11 @@ class _DynamicTableState extends State<DynamicTable> {
final row = widget.data[index];
return Row(
children: [
if (widget.withCheckBox)
_buildRowCheckbox(index),
...row.map((cell) =>
_buildTableCell(cell.toString())).toList(),
if (widget.withCheckBox) _buildRowCheckbox(index),
...row
.map((cell) =>
_buildTableCell(cell.toString()))
.toList(),
],
);
},
@ -143,7 +143,10 @@ class _DynamicTableState extends State<DynamicTable> {
alignment: Alignment.centerLeft,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(title, style: const TextStyle(fontWeight: FontWeight.bold)),
child: Text(title,
style: const TextStyle(
fontWeight: FontWeight.w400,
color: ColorsManager.lightGreyColor)),
),
),
);
@ -156,11 +159,11 @@ class _DynamicTableState extends State<DynamicTable> {
padding: const EdgeInsets.all(15.0),
decoration: const BoxDecoration(
border: Border(
bottom: BorderSide(
color: ColorsManager.boxDivider,
width: 1.0,
),
)),
bottom: BorderSide(
color: ColorsManager.boxDivider,
width: 1.0,
),
)),
alignment: Alignment.centerLeft,
child: Text(
content,