ppm update button hide for end user. & status color changed.

design_3.0_TM_Module
Sikander Saleem 1 week ago
parent c6e66e82e8
commit 985d559860

@ -146,20 +146,20 @@ class _ServiceRequestDetailViewState extends State<ServiceRequestDetailView> {
if (Provider.of<SettingProvider>(context, listen: false).showPriority) ...[
StatusLabel(
label: workOrder.priority?.name,
id: workOrder.priority!.id!,
id: workOrder.priority!.value!,
radius: 4,
textColor: AppColor.getPriorityStatusTextColor(context, workOrder.priority!.id!),
backgroundColor: AppColor.getPriorityStatusColor(context, workOrder.priority!.id!),
textColor: AppColor.getPriorityStatusTextColor(context, workOrder.priority!.value!),
backgroundColor: AppColor.getPriorityStatusColor(context, workOrder.priority!.value!),
),
8.width,
],
if (workOrder.itgFormWorkOrderStatus != null) ...[
StatusLabel(
label: workOrder.itgFormWorkOrderStatus,
id: 0,
// id: 0,
radius: 4,
textColor: AppColor.getPriorityStatusTextColor(context, 82),
backgroundColor: AppColor.getPriorityStatusColor(context, 0),
backgroundColor: AppColor.getPriorityStatusColor(context, 1000),
),
8.width,
],

@ -117,13 +117,13 @@ class _PpmDetailsPageState extends State<PpmDetailsPage> {
).paddingAll(16)
]
else ...[
AppFilledButton(
onPressed: () async {
await Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdatePpm(ppm: null, planPreventiveVisit: planPreventiveVisit)));
getVisitData();
},
label: context.translation.viewDetails,
).paddingAll(16)
// AppFilledButton(
// onPressed: () async {
// await Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdatePpm(ppm: null, planPreventiveVisit: planPreventiveVisit)));
// getVisitData();
// },
// label: context.translation.viewDetails,
// ).paddingAll(16)
]
]):const Center(child: NoDataFound());
}),

@ -258,6 +258,11 @@ static Color getActivityTypeTextColor(String type) {
return green15;
case 370:
return green15;
case 0:
return green15;
case 1:
//high priority
return white10;
case 82:
//high priority
return white10;
@ -273,9 +278,13 @@ static Color getActivityTypeTextColor(String type) {
return greenStatus(context);
case 370:
return greenStatus(context);
case 0:
return greenStatus(context);
//high priority
case 82:
return redStatus(context);
case 1:
return redStatus(context);
default:
return blueStatus(context);
}

@ -11,23 +11,23 @@ class StatusLabel extends StatelessWidget {
final double radius;
final bool labelInCenter;
StatusLabel({Key? key, this.id = 0, this.label, this.backgroundColor, this.textColor, this.isPriority = false, this.radius = 4,this.labelInCenter=false}) : super(key: key);
StatusLabel({Key? key, this.id = 0, this.label, this.backgroundColor, this.textColor, this.isPriority = false, this.radius = 4, this.labelInCenter = false}) : super(key: key);
@override
Widget build(BuildContext context) {
if (id == 82) label = context.translation.highPriority;
if (id == 81) label = context.translation.lowPriority;
if (label?.toLowerCase() == 'In progress'.toLowerCase()) label = context.translation.inProgress;
if (label?.toLowerCase() == 'Completed'.toLowerCase()) label = context.translation.completed;
if (label?.toLowerCase() == 'Open'.toLowerCase()) label = context.translation.open;
if (label?.toLowerCase() == 'Closed'.toLowerCase()) label = context.translation.closed;
if (label?.toLowerCase() == 'Low'.toLowerCase()) label = context.translation.lowPriority;
if (label?.toLowerCase() == 'No'.toLowerCase()) label = context.translation.lowPriority;
if (label?.toLowerCase() == 'High'.toLowerCase()) label = context.translation.highPriority;
if (label?.toLowerCase() == 'Yes'.toLowerCase()) label = context.translation.highPriority;
if (label?.toLowerCase() == 'Waiting for quotation'.toLowerCase()) label = context.translation.waitingForQuotation;
return Container(
padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 10),
alignment: labelInCenter ? Alignment.center: null,
alignment: labelInCenter ? Alignment.center : null,
decoration: ShapeDecoration(
color: backgroundColor,
shape: RoundedRectangleBorder(

Loading…
Cancel
Save