push fixes

This commit is contained in:
ashrafzarkanisala
2024-08-28 20:52:09 +03:00
parent cfc8d4cf2f
commit adf19818e7
9 changed files with 140 additions and 71 deletions

View File

@ -65,11 +65,14 @@ class _DynamicTableState extends State<DynamicTable> {
child: Column(
children: [
Container(
decoration: widget.headerDecoration ?? BoxDecoration(color: Colors.grey[200]),
decoration: widget.headerDecoration ??
BoxDecoration(color: Colors.grey[200]),
child: Row(
children: [
if (widget.withCheckBox) _buildSelectAllCheckbox(),
...widget.headers.map((header) => _buildTableHeaderCell(header)).toList(),
...widget.headers
.map((header) => _buildTableHeaderCell(header))
.toList(),
],
),
),
@ -93,7 +96,8 @@ class _DynamicTableState extends State<DynamicTable> {
style: Theme.of(context)
.textTheme
.bodySmall!
.copyWith(color: ColorsManager.grayColor),
.copyWith(
color: ColorsManager.grayColor),
)
],
),
@ -113,10 +117,12 @@ class _DynamicTableState extends State<DynamicTable> {
return Row(
children: [
if (widget.withCheckBox)
_buildRowCheckbox(index, widget.size.height * 0.10),
_buildRowCheckbox(
index, widget.size.height * 0.10),
...row
.map((cell) =>
_buildTableCell(cell.toString(), widget.size.height * 0.10))
.map((cell) => _buildTableCell(
cell.toString(),
widget.size.height * 0.10))
.toList(),
],
);
@ -222,7 +228,7 @@ class _DynamicTableState extends State<DynamicTable> {
statusColor = ColorsManager.red;
break;
default:
statusColor = Colors.black; // Default color
statusColor = Colors.black;
}
return Expanded(
@ -241,9 +247,11 @@ class _DynamicTableState extends State<DynamicTable> {
child: Text(
content,
style: TextStyle(
color: batteryLevel != null && batteryLevel < 20
color: (batteryLevel != null && batteryLevel < 20)
? ColorsManager.red
: statusColor, // Use the passed color or default to black
: (batteryLevel != null && batteryLevel > 20)
? ColorsManager.green
: statusColor,
fontSize: 10,
fontWeight: FontWeight.w400),
),