Merge remote-tracking branch 'origin/main_design2.0' into main_design2.0

design_3.0_internal_audit_module
nextwo 2 years ago
commit 307fd55fa1

@ -27,7 +27,7 @@ extension TextStyles on String {
Text overline(BuildContext context) => getTextWithStyle(this, AppTextStyles.overline, context.isDark ? AppColor.neutral10 : AppColor.neutral20); Text overline(BuildContext context) => getTextWithStyle(this, AppTextStyles.overline, context.isDark ? AppColor.neutral10 : AppColor.neutral20);
Text getTextWithStyle(String string, TextStyle style, Color color) => Text(string, style: style.copyWith(color: color)); Text getTextWithStyle(String string, TextStyle style, Color color) => Text(string ?? "", style: style.copyWith(color: color));
} }
extension CustomText on Text { extension CustomText on Text {

@ -78,7 +78,7 @@ class _PartNoButtonState extends State<PartNoButton> {
labelText: context.translation.quantity, labelText: context.translation.quantity,
textInputType: TextInputType.number, textInputType: TextInputType.number,
backgroundColor: context.isDark ? AppColor.neutral20 : AppColor.neutral30, backgroundColor: context.isDark ? AppColor.neutral20 : AppColor.neutral30,
enable: current != null, enable: current != null && current.sparePart?.id != null,
validator: (value) => value == null || value.isEmpty validator: (value) => value == null || value.isEmpty
? context.translation.requiredField ? context.translation.requiredField
: Validator.isNumeric(value) : Validator.isNumeric(value)

@ -49,9 +49,9 @@ class WorkOrderDetailsPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
StatusLabel( StatusLabel(
label: workOrderDetails.currentSituation.name, label: workOrderDetails.currentSituation?.name,
textColor: AppColor.getRequestStatusTextColorByName(context, workOrderDetails.currentSituation.name), textColor: AppColor.getRequestStatusTextColorByName(context, workOrderDetails.currentSituation?.name),
backgroundColor: AppColor.getRequestStatusColorByName(context, workOrderDetails.currentSituation.name), backgroundColor: AppColor.getRequestStatusColorByName(context, workOrderDetails.currentSituation?.name),
), ),
8.height, 8.height,
Text(serviceRequest.requestCode, style: AppTextStyles.heading5.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50)), Text(serviceRequest.requestCode, style: AppTextStyles.heading5.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50)),
@ -61,7 +61,7 @@ class WorkOrderDetailsPage extends StatelessWidget {
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral20), style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral20),
), ),
Text( Text(
'${context.translation.status}: ${workOrderDetails.currentSituation.name}', '${context.translation.status}: ${workOrderDetails.currentSituation?.name}',
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral20), style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral20),
), ),
Text( Text(

@ -68,7 +68,7 @@ class MultiFilesPickerItem extends StatelessWidget {
} else { } else {
if (!await launchUrl(Uri.parse(file.path), mode: LaunchMode.externalApplication)) { if (!await launchUrl(Uri.parse(file.path), mode: LaunchMode.externalApplication)) {
Fluttertoast.showToast(msg: "UnExpected Error with file."); Fluttertoast.showToast(msg: "UnExpected Error with file.");
throw Exception('Could not launch '); throw Exception('Could not launch');
} }
} }
}, },

@ -15,11 +15,11 @@ class StatusLabel extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (id == 82) label = context.translation.highPriority; if (id == 82) label = context.translation.highPriority;
if (id == 81) label = context.translation.lowPriority; if (id == 81) label = context.translation.lowPriority;
if (label.toLowerCase() == 'In progress'.toLowerCase()) label = context.translation.inProgress; if (label?.toLowerCase() == 'In progress'.toLowerCase()) label = context.translation.inProgress;
if (label.toLowerCase() == 'Complete'.toLowerCase()) label = context.translation.completed; if (label?.toLowerCase() == 'Complete'.toLowerCase()) label = context.translation.completed;
if (label.toLowerCase() == 'Open'.toLowerCase()) label = context.translation.open; if (label?.toLowerCase() == 'Open'.toLowerCase()) label = context.translation.open;
if (label.toLowerCase() == 'Closed'.toLowerCase()) label = context.translation.closed; if (label?.toLowerCase() == 'Closed'.toLowerCase()) label = context.translation.closed;
if (label.toLowerCase() == 'Waiting for quotation'.toLowerCase()) label = context.translation.waitingForQuotation; if (label?.toLowerCase() == 'Waiting for quotation'.toLowerCase()) label = context.translation.waitingForQuotation;
return Container( return Container(
padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 10), padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 10),
@ -29,7 +29,7 @@ class StatusLabel extends StatelessWidget {
borderRadius: BorderRadius.circular(50), borderRadius: BorderRadius.circular(50),
), ),
), ),
child: Text(label, style: AppTextStyles.overline.copyWith(color: textColor)), child: Text(label ?? "", style: AppTextStyles.overline.copyWith(color: textColor)),
); );
} }

Loading…
Cancel
Save