This commit is contained in:
mohammad
2024-08-27 11:27:31 +03:00
parent 2e3f130071
commit e37ce1925b
7 changed files with 77 additions and 175 deletions

View File

@ -14,7 +14,6 @@ class DynamicTable extends StatefulWidget {
final void Function(bool?)? selectAll;
final void Function(int, bool?)? onRowCheckboxChanged;
final List<String>? initialSelectedIds;
const DynamicTable({
super.key,
required this.headers,
@ -199,6 +198,20 @@ class _DynamicTableState extends State<DynamicTable> {
}
Widget _buildTableCell(String content,size) {
Color? statusColor;
switch (content) {
case 'Effective':
statusColor = ColorsManager.textGreen;
break;
case 'Expired':
statusColor = ColorsManager.red;
break;
case 'To be effective':
statusColor = ColorsManager.yaGreen;
break;
default:
statusColor = Colors.black; // Default color
}
return Expanded(
child: Container(
height:size ,
@ -213,7 +226,11 @@ class _DynamicTableState extends State<DynamicTable> {
alignment: Alignment.centerLeft,
child: Text(
content,
style: const TextStyle(color: Colors.black, fontSize: 10,fontWeight: FontWeight.w400),
style: TextStyle(
color:statusColor, // Use the passed color or default to black
fontSize: 10,
fontWeight: FontWeight.w400
),
),
),
);