diff --git a/lib/modules/pm_module/ppm_wo/ppm_details_page.dart b/lib/modules/pm_module/ppm_wo/ppm_details_page.dart index 86f5585a..622131a3 100644 --- a/lib/modules/pm_module/ppm_wo/ppm_details_page.dart +++ b/lib/modules/pm_module/ppm_wo/ppm_details_page.dart @@ -83,14 +83,14 @@ class _PpmDetailsPageState extends State { ), ], ), - 8.height, - InfoHeader16Widget(planPreventiveVisit.assetName?.cleanupWhitespace.capitalizeFirstOfEach??''), - 8.height, + InfoHeader16Widget(planPreventiveVisit.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? ''), InfoTextWidget(label: context.translation.assetNumber, value: planPreventiveVisit.asset?.assetNumber ?? '-'), InfoTextWidget(label: context.translation.assetSN, value: planPreventiveVisit.asset?.assetSerialNo ?? '-'), InfoTextWidget(label: context.translation.requestNo, value: planPreventiveVisit.visitNo ?? '-'), - const Divider().defaultStyle(context), - InfoTextWidget(label: context.translation.actualDate, value: planPreventiveVisit.acutalDateOfVisit?.toIso8601String().toAssetDetailsFormat ?? ""), + if (planPreventiveVisit.acutalDateOfVisit != null) ...[ + const Divider().defaultStyle(context), + InfoTextWidget(label: context.translation.actualDate, value: planPreventiveVisit.acutalDateOfVisit?.toIso8601String().toAssetDetailsFormat ?? ""), + ], const Divider().defaultStyle(context), InfoTextWidget(label: context.translation.assignedEmployee, value: planPreventiveVisit.assignedEmployee?.userName ?? ""), InfoTextWidget(label: context.translation.site, value: planPreventiveVisit.siteName?.cleanupWhitespace.capitalizeFirstOfEach ?? '-'), diff --git a/lib/modules/pm_module/ppm_wo/update_ppm/ppm_calibration_tools_form.dart b/lib/modules/pm_module/ppm_wo/update_ppm/ppm_calibration_tools_form.dart index 34fedcad..4e5d87ab 100644 --- a/lib/modules/pm_module/ppm_wo/update_ppm/ppm_calibration_tools_form.dart +++ b/lib/modules/pm_module/ppm_wo/update_ppm/ppm_calibration_tools_form.dart @@ -14,6 +14,8 @@ import 'package:test_sa/models/plan_preventive_visit/plan_preventive_visit_model import 'package:test_sa/new_views/app_style/app_color.dart'; import 'package:test_sa/new_views/common_widgets/app_filled_button.dart'; import 'package:test_sa/views/widgets/date_and_time/date_picker.dart'; +import 'package:test_sa/views/widgets/item_views/info_header_widget.dart'; +import 'package:test_sa/views/widgets/item_views/info_text_widget.dart'; import 'package:test_sa/views/widgets/pentry/calibration_tool_asset_picker.dart'; class PpmCalibrationToolsForm extends StatefulWidget { @@ -44,7 +46,7 @@ class _PpmCalibrationToolsFormState extends State { label: "Add More Calibration Tools".addTranslation, maxWidth: true, textColor: AppColor.headingTextColor(context), - buttonColor: context.isDark ? AppColor.neutral60 : AppColor.white10, + buttonColor: AppColor.addItemButtonColor(context), icon: Icon(Icons.add_circle, color: AppColor.blueStatus(context)), showIcon: true, onPressed: () async { @@ -73,14 +75,15 @@ class _PpmCalibrationToolsFormState extends State { boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.03), blurRadius: 14)], ), child: IgnorePointer( - ignoring:ppmProvider.isReadOnly, + ignoring: ppmProvider.isReadOnly, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - (index == 0 ? "$currentIndex /$totalTabs . Calibration Tools" : "").heading5(context).custom(color: AppColor.textStyleColor(context)), + InfoHeader16Widget((index == 0 ? "$currentIndex /$totalTabs . Calibration Tools" : "")), + // (index == 0 ? "$currentIndex /$totalTabs . Calibration Tools" : "").heading5(context).custom(color: AppColor.textStyleColor(context)), "trash".toSvgAsset(height: 20, width: 15).onPress(() { widget.models!.remove(model); setState(() {}); @@ -97,16 +100,16 @@ class _PpmCalibrationToolsFormState extends State { }, ), 12.height, - if (model.asset?.assetNumber != null) - Text("Asset Number: ${model.asset?.assetNumber?.cleanupWhitespace.capitalizeFirstOfEach}", style: AppTextStyles.bodyText2.copyWith(color: AppColor.neutral120)), + if (model.asset?.assetNumber != null) InfoTextWidget(label: 'Asset Number'.addTranslation, value: model.asset?.assetNumber?.cleanupWhitespace.capitalizeFirstOfEach ?? '-'), + // Text("Asset Number: ${model.asset?.assetNumber?.cleanupWhitespace.capitalizeFirstOfEach}", style: AppTextStyles.bodyText2.copyWith(color: AppColor.neutral120)), // if (model.assetName != null) Text("Asset Name: ${model.assetName?.cleanupWhitespace.capitalizeFirstOfEach}", style: AppTextStyles.bodyText2.copyWith(color: AppColor.neutral120)), - if (model.asset?.assetSerialNo != null) - Text("Asset Serial No: ${model.asset?.assetSerialNo?.cleanupWhitespace.capitalizeFirstOfEach}", style: AppTextStyles.bodyText2.copyWith(color: AppColor.neutral120)), + if (model.asset?.assetSerialNo != null) InfoTextWidget(label: 'Asset Serial No'.addTranslation, value: model.asset?.assetSerialNo?.cleanupWhitespace.capitalizeFirstOfEach ?? '-'), + // Text("Asset Serial No: ${model.asset?.assetSerialNo?.cleanupWhitespace.capitalizeFirstOfEach}", style: AppTextStyles.bodyText2.copyWith(color: AppColor.neutral120)), 12.height, ADatePicker( label: context.translation.calibrationDate, date: DateTime.tryParse(model.calibrationDateOfTesters ?? ""), - from: DateTime.now().subtract(const Duration(days: 10*365)), + from: DateTime.now().subtract(const Duration(days: 10 * 365)), backgroundColor: AppColor.fieldBgColor(context), withBorder: false, hideShadow: true, diff --git a/lib/modules/pm_module/ppm_wo/update_ppm/ppm_external_details_form.dart b/lib/modules/pm_module/ppm_wo/update_ppm/ppm_external_details_form.dart index 8837ce84..cff873cc 100644 --- a/lib/modules/pm_module/ppm_wo/update_ppm/ppm_external_details_form.dart +++ b/lib/modules/pm_module/ppm_wo/update_ppm/ppm_external_details_form.dart @@ -19,6 +19,7 @@ import 'package:test_sa/providers/work_order/vendor_provider.dart'; import 'package:test_sa/views/pages/user/requests/add_supplier_engineer_bottom_sheet.dart'; import 'package:test_sa/views/widgets/date_and_time/date_picker.dart'; import 'package:test_sa/views/widgets/date_and_time/time_picker.dart'; +import 'package:test_sa/views/widgets/item_views/info_header_widget.dart'; class PpmExternalDetailsForm extends StatefulWidget { final List? models; @@ -68,7 +69,8 @@ class _PpmExternalDetailsFormState extends State { label: "Add More External Details".addTranslation, maxWidth: true, textColor: AppColor.headingTextColor(context), - buttonColor: context.isDark ? AppColor.neutral60 : AppColor.white10, + // buttonColor: context.isDark ? AppColor.neutral60 : AppColor.white10, + buttonColor: AppColor.addItemButtonColor(context), icon: Icon(Icons.add_circle, color: AppColor.blueStatus(context)), showIcon: true, onPressed: _addNewEntry, @@ -135,7 +137,8 @@ class _ExternalDetailItemState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - (widget.index == 0 ? "1 /4 . External Details" : "").heading5(context).custom(color: AppColor.textStyleColor(context)), + InfoHeader16Widget((widget.index == 0 ? "1 /4 . External Details" : "")), + // (widget.index == 0 ? "1 /4 . External Details" : "").heading5(context).custom(color: AppColor.textStyleColor(context)), Container( height: 32, width: 32, diff --git a/lib/modules/pm_module/ppm_wo/update_ppm/ppm_pm_check_list_form.dart b/lib/modules/pm_module/ppm_wo/update_ppm/ppm_pm_check_list_form.dart index f27968c6..fd49cb65 100644 --- a/lib/modules/pm_module/ppm_wo/update_ppm/ppm_pm_check_list_form.dart +++ b/lib/modules/pm_module/ppm_wo/update_ppm/ppm_pm_check_list_form.dart @@ -13,6 +13,7 @@ import 'package:test_sa/new_views/app_style/app_color.dart'; import 'package:test_sa/new_views/common_widgets/app_text_form_field.dart'; import 'package:test_sa/new_views/common_widgets/single_item_drop_down_menu.dart'; import 'package:test_sa/providers/ppm_checklist_status_provider.dart'; +import 'package:test_sa/views/widgets/item_views/info_header_widget.dart'; import 'package:test_sa/views/widgets/loaders/no_data_found.dart'; class PpmPmChecklistForm extends StatefulWidget { @@ -50,7 +51,9 @@ class _PpmPmChecklistFormState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ if (index == 0) ...[ - "$currentIndex /$totalTabs . PM Checklist".heading5(context).custom(color: AppColor.textStyleColor(context)), + + // "$currentIndex /$totalTabs . PM Checklist".heading5(context).custom(color: AppColor.textStyleColor(context)), + InfoHeader16Widget("$currentIndex /$totalTabs . PM Checklist"), 16.height, ], AppTextFormField( diff --git a/lib/modules/pm_module/ppm_wo/update_ppm/ppm_pm_kits_form.dart b/lib/modules/pm_module/ppm_wo/update_ppm/ppm_pm_kits_form.dart index 022c4125..5ab4a96a 100644 --- a/lib/modules/pm_module/ppm_wo/update_ppm/ppm_pm_kits_form.dart +++ b/lib/modules/pm_module/ppm_wo/update_ppm/ppm_pm_kits_form.dart @@ -10,6 +10,7 @@ import 'package:test_sa/extensions/widget_extensions.dart'; import 'package:test_sa/models/plan_preventive_visit/plan_preventive_visit_model.dart'; import 'package:test_sa/new_views/app_style/app_color.dart'; import 'package:test_sa/new_views/common_widgets/app_filled_button.dart'; +import 'package:test_sa/views/widgets/item_views/info_header_widget.dart'; import 'package:test_sa/views/widgets/parts/auto_complete_parts_field.dart'; @@ -41,7 +42,8 @@ class _PpmPMKitsFormState extends State { label: "Add More PM Kits".addTranslation, maxWidth: true, textColor: AppColor.headingTextColor(context), - buttonColor: context.isDark ? AppColor.neutral60 : AppColor.white10, + // buttonColor: AppColor.dropDownBackground(context), + buttonColor: AppColor.addItemButtonColor(context), icon: Icon(Icons.add_circle, color: AppColor.blueStatus(context)), showIcon: true, onPressed: () async { @@ -78,7 +80,8 @@ class _PpmPMKitsFormState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - (index == 0 ? "$currentIndex /$totalTabs . PM Kits" : "").heading5(context).custom(color: AppColor.textStyleColor(context)), + InfoHeader16Widget((index == 0 ? "$currentIndex /$totalTabs . PM Kits" : "")), + // (index == 0 ? "$currentIndex /$totalTabs . PM Kits" : "").heading5(context).custom(color: AppColor.textStyleColor(context)), Container( height: 32, width: 32, diff --git a/lib/modules/pm_module/ppm_wo/update_ppm/wo_info_form.dart b/lib/modules/pm_module/ppm_wo/update_ppm/wo_info_form.dart index f8dd3d91..55170e3b 100644 --- a/lib/modules/pm_module/ppm_wo/update_ppm/wo_info_form.dart +++ b/lib/modules/pm_module/ppm_wo/update_ppm/wo_info_form.dart @@ -33,6 +33,8 @@ import 'package:test_sa/views/widgets/bottom_sheets/asset_detail_bottom_sheet.da import 'package:test_sa/views/widgets/date_and_time/date_picker.dart'; import 'package:test_sa/views/widgets/date_and_time/time_picker.dart'; import 'package:test_sa/views/widgets/images/multi_image_picker.dart'; +import 'package:test_sa/views/widgets/item_views/info_header_widget.dart'; +import 'package:test_sa/views/widgets/item_views/info_text_widget.dart'; import 'package:test_sa/views/widgets/requests/request_status.dart'; import 'package:test_sa/views/widgets/timer/app_timer.dart'; import 'package:test_sa/views/widgets/total_working_time_detail_bottomsheet.dart'; @@ -80,7 +82,6 @@ class _WoInfoFormState extends State { return sum; } }); - print('totol working hours ${totalWorkingHours}'); timerList = timers.map((e) { return TimerHistoryModel( id: e.id, @@ -114,22 +115,34 @@ class _WoInfoFormState extends State { textColor: AppColor.getRequestStatusTextColorByName(context, widget.planPreventiveVisit.visitStatus?.name), backgroundColor: AppColor.getRequestStatusColorByName(context, widget.planPreventiveVisit.visitStatus?.name), ), - 8.height, - widget.planPreventiveVisit.planName!.bodyText(context).custom(color: AppColor.headingTextColor(context)), - 2.height, - '${context.translation.pmPlanNo}: ${widget.planPreventiveVisit.planNo}'.bodyText2(context).custom(color: AppColor.neutral120), + InfoHeader16Widget(widget.planPreventiveVisit.planName!), + // widget.planPreventiveVisit.planName!.bodyText(context).custom(color: AppColor.headingTextColor(context)), + InfoTextWidget( + label: context.translation.pmPlanNo, + value: widget.planPreventiveVisit.planNo, + ), + InfoTextWidget( + label: 'Work Order Number'.addTranslation, + value: widget.planPreventiveVisit.visitNo, + ), + InfoTextWidget(label: context.translation.creationDate, value: widget.planPreventiveVisit.creationDate?.toMonthYearFormat), + InfoTextWidget(label: context.translation.closedDate, value: widget.planPreventiveVisit.closedDate != null ? widget.planPreventiveVisit.closedDate?.toMonthYearFormat : '-'), + InfoTextWidget(label: context.translation.nextPmDate, value: widget.planPreventiveVisit.nextPMDate != null ? widget.planPreventiveVisit.nextPMDate!.toMonthYearFormat : '-'), + InfoTextWidget(label: context.translation.assignEngineer, value: widget.planPreventiveVisit.assignedEmployee?.userName), + InfoTextWidget(label: context.translation.executionTimeFrame, value: '${widget.planPreventiveVisit.executionTimeFrame ?? ""} days'), + // '${context.translation.pmPlanNo}: ${widget.planPreventiveVisit.planNo}'.bodyText2(context).custom(color: AppColor.neutral120), //need to add in translation it's suggestion from ahmed.. - 'Work Order Number: ${widget.planPreventiveVisit.visitNo}'.bodyText2(context).custom(color: AppColor.neutral120), - '${context.translation.creationDate}: ${widget.planPreventiveVisit.creationDate?.toMonthYearFormat}'.bodyText2(context).custom(color: AppColor.neutral120), - '${context.translation.closedDate}: ${widget.planPreventiveVisit.closedDate != null ? widget.planPreventiveVisit.closedDate?.toMonthYearFormat : '-'}' - .bodyText2(context) - .custom(color: AppColor.neutral120), + // 'Work Order Number: ${widget.planPreventiveVisit.visitNo}'.bodyText2(context).custom(color: AppColor.neutral120), + // '${context.translation.creationDate}: ${widget.planPreventiveVisit.creationDate?.toMonthYearFormat}'.bodyText2(context).custom(color: AppColor.neutral120), + // '${context.translation.closedDate}: ${widget.planPreventiveVisit.closedDate != null ? widget.planPreventiveVisit.closedDate?.toMonthYearFormat : '-'}' + // .bodyText2(context) + // .custom(color: AppColor.neutral120), - '${context.translation.nextPmDate}: ${widget.planPreventiveVisit.nextPMDate != null ? widget.planPreventiveVisit.nextPMDate!.toMonthYearFormat : '-'}' - .bodyText2(context) - .custom(color: AppColor.neutral120), - '${context.translation.assignEngineer}: ${widget.planPreventiveVisit.assignedEmployee?.userName ?? ""}'.bodyText2(context).custom(color: AppColor.neutral120), - '${context.translation.executionTimeFrame}: ${widget.planPreventiveVisit.executionTimeFrame ?? ""} days'.bodyText2(context).custom(color: AppColor.neutral120), + // '${context.translation.nextPmDate}: ${widget.planPreventiveVisit.nextPMDate != null ? widget.planPreventiveVisit.nextPMDate!.toMonthYearFormat : '-'}' + // .bodyText2(context) + // .custom(color: AppColor.neutral120), + // '${context.translation.assignEngineer}: ${widget.planPreventiveVisit.assignedEmployee?.userName ?? ""}'.bodyText2(context).custom(color: AppColor.neutral120), + // '${context.translation.executionTimeFrame}: ${widget.planPreventiveVisit.executionTimeFrame ?? ""} days'.bodyText2(context).custom(color: AppColor.neutral120), ], ).toShadowContainer(context), 12.height, @@ -139,19 +152,22 @@ class _WoInfoFormState extends State { children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - widget.planPreventiveVisit.assetName!.bodyText(context).custom(color: AppColor.headingTextColor(context)).expanded, + InfoHeader16Widget(widget.planPreventiveVisit.assetName ?? '').expanded, + // widget.planPreventiveVisit.assetName!.bodyText(context).custom(color: AppColor.headingTextColor(context)).expanded, "info_icon".toSvgAsset(height: 17, width: 17).onPress( () { // There is only limited information for asset is returned from backend to show all info need to return the whole model from backend... showModalBottomSheet( context: context, + backgroundColor: AppColor.bottomSheetColor(context), isScrollControlled: true, - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.vertical( - top: Radius.circular(20), - ), - ), + // shape: const RoundedRectangleBorder( + // borderRadius: BorderRadius.vertical( + // top: Radius.circular(20), + // ), + // ), clipBehavior: Clip.antiAliasWithSaveLayer, builder: (BuildContext context) => _buildAssetDetailBottomSheet(context), ); @@ -159,9 +175,17 @@ class _WoInfoFormState extends State { ) ], ), - 2.height, - '${context.translation.assetNo}: ${widget.planPreventiveVisit.asset?.assetNumber}'.bodyText2(context).custom(color: AppColor.lightTextColor(context)), - '${context.translation.model}: ${widget.planPreventiveVisit.model}'.bodyText2(context).custom(color: AppColor.lightTextColor(context)), + // 2.height, + InfoTextWidget( + label: context.translation.assetNo, + value: widget.planPreventiveVisit.asset?.assetNumber, + ), + InfoTextWidget( + label: context.translation.model, + value: widget.planPreventiveVisit.model, + ), + // '${context.translation.assetNo}: ${widget.planPreventiveVisit.asset?.assetNumber}'.bodyText2(context).custom(color: AppColor.lightTextColor(context)), + // '${context.translation.model}: ${widget.planPreventiveVisit.model}'.bodyText2(context).custom(color: AppColor.lightTextColor(context)), ], ).toShadowContainer(context), @@ -205,7 +229,7 @@ class _WoInfoFormState extends State { initialValue: widget.planPreventiveVisit.taskStatus == null ? null : Lookup(name: widget.planPreventiveVisit.taskStatus?.name ?? "", id: widget.planPreventiveVisit.taskStatus?.id), title: context.translation.pmTestResult, - backgroundColor: AppColor.fieldBgColor(context), + // backgroundColor: AppColor.fieldBgColor(context), onSelect: (value) { if (value != null) { widget.planPreventiveVisit.taskStatus = value; @@ -374,7 +398,7 @@ class _WoInfoFormState extends State { room: Rooms(value: int.tryParse(model.roomName ?? '')), department: Department(departmentName: model.departmentName), ); - return AssetDetailBottomSheet(asset); + return AssetDetailBottomSheet(asset).bottomSheetContainer(context); } // Future getAssetById () async { @@ -392,7 +416,7 @@ class _WoInfoFormState extends State { children: [ AppTimer( label: context.translation.workingHours, - decoration: BoxDecoration(color: AppColor.fieldBgColor(context), borderRadius: BorderRadius.circular(10)), + // decoration: BoxDecoration(color: AppColor.fieldBgColor(context), borderRadius: BorderRadius.circular(10)), width: double.infinity, timer: widget.planPreventiveVisit.tbsTimer, pickerTimer: widget.planPreventiveVisit.ppMTimePicker, diff --git a/lib/modules/tm_module/device_transfer/device_transfer_details.dart b/lib/modules/tm_module/device_transfer/device_transfer_details.dart index 4423087e..a7579fb2 100644 --- a/lib/modules/tm_module/device_transfer/device_transfer_details.dart +++ b/lib/modules/tm_module/device_transfer/device_transfer_details.dart @@ -89,7 +89,7 @@ class _DeviceTransferDetailsState extends State { backgroundColor: AppColor.getRequestStatusColorByName(context, _model?.transferType?.name), ), 1.width.expanded, - InfoDateWidget(_model?.createdOn?.toString() ?? ""), + InfoDateWidget(_model?.createdDate?.toString() ?? ""), ], ), 8.height, @@ -240,31 +240,38 @@ class _DeviceTransferDetailsState extends State { ), if ((_userProvider!.user?.type == UsersTypes.engineer)) if (isCurrentEngineerEligibleForEdit && isCurrentRequestEditAble) - "edit".toSvgAsset(height: 40, width: 40).onPress(() async { + "edit_icon".toSvgAsset(height: 24, width: 24, color: AppColor.icon2Color(context)).onPress(() async { bool isReload = (await Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdateDeviceTransfer(model: _model!, isSender: true)))) as bool; if (isReload ?? false) { setState(() {}); } }), + // "edit".toSvgAsset(height: 40, width: 40).onPress(() async { + // bool isReload = (await Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdateDeviceTransfer(model: _model!, isSender: true)))) as bool; + // if (isReload ?? false) { + // setState(() {}); + // } + // }), ], ), 8.height, context.translation.workOrderDetails.heading5(context).custom(color: AppColor.textStyleColor(context)), - infoText(label: context.translation.destinationSite, value: _model?.senderSiteName), + InfoTextWidget(label: context.translation.destinationSite, value: _model?.senderSiteName), // infoText(label: "Sender Building".addTranslation, value: _model?.senderBuildingName), // infoText(label: "Sender Floor".addTranslation, value: _model?.senderFloorName), // infoText(label: "Sender Department".addTranslation, value: _model?.senderDepartmentName), - infoText(label: "Building".addTranslation, value: _model?.destBuildingName), - infoText(label: "Floor".addTranslation, value: _model?.destFloorName), - infoText(label: "Department".addTranslation, value: _model?.destDepartmentName), + InfoTextWidget(label: "Building".addTranslation, value: _model?.destBuildingName), + InfoTextWidget(label: "Floor".addTranslation, value: _model?.destFloorName), + InfoTextWidget(label: "Department".addTranslation, value: _model?.destDepartmentName), if (_model!.senderComment != null && _model!.senderComment!.isNotEmpty) ...[ - 8.height, const Divider().defaultStyle(context), - Text( - "Technical Comments".addTranslation, - style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50), - ), - _buildTextWidget(_model?.senderComment ?? ''), + InfoHeader16Widget("Technical Comments".addTranslation), + // Text( + // "Technical Comments".addTranslation, + // style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50), + // ), + InfoTextLabelWidget(label: _model?.senderComment ?? ''), + // _buildTextWidget(_model?.senderComment ?? ''), ], if (engineerCanAssignToHimself) ...[ @@ -310,7 +317,8 @@ class _DeviceTransferDetailsState extends State { {required String site, String? building, String? dept, String? floor, required String comment, required bool isSender, StatusLabel? statusLabel, String? assignTo}) { bool isCurrentEngineerEligibleForEdit = isSender ? _model?.senderAssignedEmployeeId == _userProvider!.user?.userID : _model?.receiverAssignedEmployeeId == _userProvider!.user?.userID; - bool isCurrentRequestClosed = isSender ? ((_model?.senderMachineStatusValue == 3 || _model?.senderMachineStatusValue == 5)) : ((_model?.receiverMachineStatusValue == 3 || _model?.receiverMachineStatusValue == 5)); + bool isCurrentRequestClosed = + isSender ? ((_model?.senderMachineStatusValue == 3 || _model?.senderMachineStatusValue == 5)) : ((_model?.receiverMachineStatusValue == 3 || _model?.receiverMachineStatusValue == 5)); bool isCurrentRequestOpen = isSender ? ((_model?.senderMachineStatusValue == 4)) : ((_model?.receiverMachineStatusValue == 4)); bool isCurrentRequestInProgress = isSender ? ((_model?.senderMachineStatusValue == 1)) : ((_model?.receiverMachineStatusValue == 1)); @@ -329,7 +337,8 @@ class _DeviceTransferDetailsState extends State { children: [ statusLabel ?? Container(), if (statusLabel != null) 8.height, - isSender ? context.translation.senderDetails.heading5(context) : context.translation.receiverDetails.heading5(context).custom(color: AppColor.textStyleColor(context)), + InfoHeader16Widget(isSender ? context.translation.senderDetails : context.translation.receiverDetails), + // isSender ? context.translation.senderDetails.heading5(context) : context.translation.receiverDetails.heading5(context).custom(color: AppColor.textStyleColor(context)), ], ).expanded, if (context.userProvider.isEngineer || context.userProvider.isNurse) @@ -349,27 +358,34 @@ class _DeviceTransferDetailsState extends State { // ? (!(_model?.senderMachineStatusName?.toLowerCase()?.contains("close") ?? false) && !(_model?.senderMachineStatusName?.toLowerCase()?.contains("complete") ?? false)) // : (!(_model?.receiverMachineStatusName?.toLowerCase()?.contains("close") ?? false) && !(_model?.receiverMachineStatusName?.toLowerCase()?.contains("complete") ?? false))) // - "edit".toSvgAsset(height: 48, width: 48).onPress(() async { + "edit_icon".toSvgAsset(height: 24, width: 24, color: AppColor.icon2Color(context)).onPress(() async { bool isReload = (await Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdateDeviceTransfer(model: _model!, isSender: isSender)))) as bool; if (isReload ?? false) { setState(() {}); } }), + // "edit".toSvgAsset(height: 48, width: 48).onPress(() async { + // bool isReload = (await Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdateDeviceTransfer(model: _model!, isSender: isSender)))) as bool; + // if (isReload ?? false) { + // setState(() {}); + // } + // }), ], ), - infoText(label: context.translation.site, value: site), - infoText(label: context.translation.building, value: building), - infoText(label: context.translation.floor, value: floor), - infoText(label: context.translation.department, value: dept), - infoText(label: context.translation.assignedTo, value: assignTo), + InfoTextWidget(label: context.translation.site, value: site), + InfoTextWidget(label: context.translation.building, value: building), + InfoTextWidget(label: context.translation.floor, value: floor), + InfoTextWidget(label: context.translation.department, value: dept), + InfoTextWidget(label: context.translation.assignedTo, value: assignTo), if (comment.isNotEmpty) ...[ - 8.height, const Divider().defaultStyle(context), - Text( - "Technical Comments".addTranslation, - style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50), - ), - _buildTextWidget(comment), + InfoHeader16Widget("Technical Comments".addTranslation), + InfoTextLabelWidget(label: comment), + // Text( + // "Technical Comments".addTranslation, + // style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50), + // ), + // _buildTextWidget(comment), ], if (engineerCanAssignToHimself) ...[ 16.height, @@ -416,12 +432,13 @@ class _DeviceTransferDetailsState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ const Divider().defaultStyle(context), - Text( - "Contact Info".addTranslation, - style: AppTextStyles.heading6.copyWith( - color: context.isDark ? AppColor.neutral30 : AppColor.neutral50, - ), - ), + InfoHeader16Widget("Contact Info".addTranslation), + // Text( + // "Contact Info".addTranslation, + // style: AppTextStyles.heading6.copyWith( + // color: context.isDark ? AppColor.neutral30 : AppColor.neutral50, + // ), + // ), ..._model!.assetTransferContactPersons!.asMap().entries.map((entry) { final index = entry.key; final person = entry.value; @@ -430,12 +447,11 @@ class _DeviceTransferDetailsState extends State { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const SizedBox(height: 8), - infoText(label: context.translation.employeeId, value: person.employeeNumber), - infoText(label: context.translation.name, value: person.employeeName), - infoText(label: context.translation.email, value: person.email), - infoText(label: context.translation.phoneNumber, value: person.mobileNo), - infoText(label: context.translation.extensionNo, value: person.extension), + InfoTextWidget(label: context.translation.employeeId, value: person.employeeNumber), + InfoTextWidget(label: context.translation.name, value: person.employeeName), + InfoTextWidget(label: context.translation.email, value: person.email), + InfoTextWidget(label: context.translation.phoneNumber, value: person.mobileNo), + InfoTextWidget(label: context.translation.extensionNo, value: person.extension), if (!isLast && _model!.assetTransferContactPersons!.length > 1) const Divider().defaultStyle(context), ], ); @@ -445,15 +461,4 @@ class _DeviceTransferDetailsState extends State { } return const SizedBox(); } - - Widget infoText({ - String? label, - String? value, - }) { - if (value == null || value.isEmpty) { - return const SizedBox(); - } else { - return '$label: $value'.bodyText(context); - } - } } diff --git a/lib/new_views/app_style/app_color.dart b/lib/new_views/app_style/app_color.dart index ad7abf2a..130b2d62 100644 --- a/lib/new_views/app_style/app_color.dart +++ b/lib/new_views/app_style/app_color.dart @@ -198,6 +198,7 @@ class AppColor { static Color noButtonColor(BuildContext context) => context.isDark ? AppColor.neutral70 : AppColor.white60; static Color filterButtonTextColor(BuildContext context) => context.isDark ? neutral30 : neutral50; + static Color addItemButtonColor(BuildContext context) => context.isDark ? AppColor.neutral60 : AppColor.white10; static Color getRequestStatusTextColorByName(BuildContext context, String? status) { switch ((status ?? "").toLowerCase()) { diff --git a/lib/views/widgets/parts/auto_complete_parts_field.dart b/lib/views/widgets/parts/auto_complete_parts_field.dart index 566c0b8f..a668e7dc 100644 --- a/lib/views/widgets/parts/auto_complete_parts_field.dart +++ b/lib/views/widgets/parts/auto_complete_parts_field.dart @@ -55,7 +55,7 @@ class _AutoCompletePartsFieldState extends State { _settingProvider = Provider.of(context); _userProvider = Provider.of(context); _partsProvider = Provider.of(context); - final border = UnderlineInputBorder(borderSide: BorderSide.none, borderRadius: BorderRadius.circular(10)); + final border = UnderlineInputBorder(borderSide: BorderSide.none, borderRadius: BorderRadius.circular(16)); return Container( decoration: BoxDecoration( color: AppColor.background(context), @@ -88,7 +88,7 @@ class _AutoCompletePartsFieldState extends State { constraints: const BoxConstraints(), suffixIconConstraints: const BoxConstraints(minWidth: 0), filled: true, - fillColor: AppColor.fieldBgColor(context), + fillColor: AppColor.dropDownBackground(context), errorStyle: AppTextStyle.tiny.copyWith(color: context.isDark ? AppColor.red50 : AppColor.red60), floatingLabelStyle: AppTextStyle.body1.copyWith(fontWeight: FontWeight.w500, color: context.isDark ? null : AppColor.neutral20), labelText: widget.byName ? context.translation.partName : context.translation.partNumber, diff --git a/lib/views/widgets/pentry/calibration_tool_asset_picker.dart b/lib/views/widgets/pentry/calibration_tool_asset_picker.dart index 740c6f58..f9c6c689 100644 --- a/lib/views/widgets/pentry/calibration_tool_asset_picker.dart +++ b/lib/views/widgets/pentry/calibration_tool_asset_picker.dart @@ -64,7 +64,7 @@ class _CalibrationToolAssetPickerState extends State PickAsset( showAssetInfo: false, forPPM: true, - cardColor: AppColor.fieldBgColor(context), + cardColor: AppColor.dropDownBackground(context), device: widget.initialValue == null ? null : Asset(