diff --git a/lib/models/plan_preventive_visit/plan_preventive_visit_model.dart b/lib/models/plan_preventive_visit/plan_preventive_visit_model.dart index 87087c3b..1feb33d7 100644 --- a/lib/models/plan_preventive_visit/plan_preventive_visit_model.dart +++ b/lib/models/plan_preventive_visit/plan_preventive_visit_model.dart @@ -197,7 +197,6 @@ class PlanPreventiveVisit { }); } if (json['activitySparePartsPPM'] != null) { - log("activitySparePartsPPM: ${json['activitySparePartsPPM']}"); activities = []; json['activitySparePartsPPM'].forEach((v) { activities!.add(PMSparePartActivityModel.fromJson(v)); diff --git a/lib/modules/cm_module/views/forms/spare_part/spare_part_request.dart b/lib/modules/cm_module/views/forms/spare_part/spare_part_request.dart index 2cc85ef4..f961f470 100644 --- a/lib/modules/cm_module/views/forms/spare_part/spare_part_request.dart +++ b/lib/modules/cm_module/views/forms/spare_part/spare_part_request.dart @@ -1,4 +1,3 @@ - import 'dart:convert'; import 'dart:developer'; import 'dart:io'; @@ -27,6 +26,7 @@ import 'package:test_sa/new_views/common_widgets/default_app_bar.dart'; import 'package:test_sa/new_views/common_widgets/single_item_drop_down_menu.dart'; import 'package:test_sa/providers/loading_list_notifier.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/loaders/no_data_found.dart'; @@ -80,8 +80,7 @@ class _SparePartRequestState extends State { activityStatus: statusLookup, comment: '', ); - } else if (widget.provider.sparePartHelperModel == null || - widget.provider.sparePartHelperModel?.id != widget.model?.id) { + } else if (widget.provider.sparePartHelperModel == null || widget.provider.sparePartHelperModel?.id != widget.model?.id) { widget.provider.sparePartHelperModel = SparePartHelperModel( id: widget.model?.id ?? 0, workOrderId: widget.fromCm ? widget.model?.workOrderId ?? widget.provider.currentWorkOrder?.data?.requestId : null, @@ -102,9 +101,7 @@ class _SparePartRequestState extends State { Future _loadInitialData() async { setState(() => _isLoading = true); _spareParts = await _partsProvider!.getPartsListByDisplayName( - assetId: widget.fromCm - ? widget.provider.currentWorkOrder?.data?.asset?.id - : widget.provider.planPreventiveVisit.asset.id, + assetId: widget.fromCm ? widget.provider.currentWorkOrder?.data?.asset?.id : widget.provider.planPreventiveVisit.asset.id, ); final bool isNewActivity = widget.model?.id == null || widget.model?.id == 0; _attachments = []; @@ -183,9 +180,9 @@ class _SparePartRequestState extends State { ) { return Column( crossAxisAlignment: CrossAxisAlignment.stretch, + spacing: 12, children: [ - context.translation.sparePartDetails.heading5(context).custom(color: AppColor.textStyleColor(context)), - 12.height, + InfoHeader16Widget(context.translation.sparePartDetails), SingleItemDropDownMenu( context: context, title: context.translation.part, @@ -202,9 +199,8 @@ class _SparePartRequestState extends State { }, ), if (model?.sparePart?.id != null) ...[ - 12.height, SizedBox( - height: 30.toScreenHeight, + // height: 30.toScreenHeight, child: Text( 'View Parts Availability', style: TextStyle( @@ -227,8 +223,6 @@ class _SparePartRequestState extends State { }), ), ], - - 12.height, AppTextFormField( key: ValueKey('quantity_${model?.quantity}'), initialValue: model?.quantity?.round().toString() ?? '', @@ -248,9 +242,6 @@ class _SparePartRequestState extends State { model?.quantity = num.tryParse(text ?? ''); }, ), - - 12.height, - if (showInstallAndReturnQty) ...[ AppTextFormField( key: ValueKey('installQty_${model?.installQty}'), @@ -271,7 +262,6 @@ class _SparePartRequestState extends State { model?.installQty = num.tryParse(text ?? ''); }, ), - 12.height, AppTextFormField( key: ValueKey('returnQty_${model?.returnQty}'), initialValue: model?.returnQty?.round().toString() ?? '', @@ -291,7 +281,6 @@ class _SparePartRequestState extends State { model?.returnQty = num.tryParse(text ?? ''); }, ), - 12.height, ], AppTextFormField( key: ValueKey('oracle_${model?.sparePart?.oracleCode}'), @@ -302,8 +291,6 @@ class _SparePartRequestState extends State { backgroundColor: AppColor.disableFieldBackground(context), enable: false, ), - - 12.height, AppTextFormField( key: ValueKey('comment_${model?.comment}'), initialValue: model?.comment ?? '', @@ -319,8 +306,6 @@ class _SparePartRequestState extends State { model?.comment = value; }, ), - - 12.height, AttachmentPicker( label: context.translation.attachQuotation, attachment: _attachments, @@ -384,20 +369,16 @@ class _SparePartRequestState extends State { provider.getWorkOrderById( id: provider.currentWorkOrder!.data!.requestId!, ); - } - else{ + } else { provider.getPlanPreventiveVisitById( - int.tryParse(provider.planPreventiveVisit?.id ?? ''), + int.tryParse(provider.planPreventiveVisit?.id ?? ''), ); } if (mounted) Navigator.pop(context); // Close form if (model?.id == 0) { - ServiceRequestBottomSheet.addAnotherSpareRequestBottomSheet( - context: context, - fromCm: widget.fromCm - ); + ServiceRequestBottomSheet.addAnotherSpareRequestBottomSheet(context: context, fromCm: widget.fromCm); const SizedBox().flushBar( context: context, title: context.translation.sparePartActivitySuccess, @@ -426,8 +407,8 @@ class PartDetailBottomSheetSheet extends StatelessWidget { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - 8.height, - 'Parts Availability'.heading6(context).paddingOnly(top: 12, start: 12), + 12.height, + 'Parts Availability'.heading4(context), Expanded( child: ListenableBuilder( listenable: provider, @@ -444,10 +425,7 @@ class PartDetailBottomSheetSheet extends StatelessWidget { separatorBuilder: (czt, index) => 12.height, itemBuilder: (context, index) { StoreAvailability model = provider.storeAvailability[index]; - return _partAvailableQuantityCard( - context: context, - model: model, - ); + return _partAvailableQuantityCard(context: context, model: model); }, ); }, @@ -458,31 +436,24 @@ class PartDetailBottomSheetSheet extends StatelessWidget { ); } - Widget _partAvailableQuantityCard({ - required StoreAvailability model, - required BuildContext context, - }) { + Widget _partAvailableQuantityCard({required StoreAvailability model, required BuildContext context}) { return Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ InfoTextWidget( - label: "Site Name:".addTranslation, + label: "Site Name".addTranslation, value: model.siteName ?? '', ), InfoTextWidget( - label: "Store Name:".addTranslation, + label: "Store Name".addTranslation, value: model.storeName ?? '', ), InfoTextWidget( - label: "Available Quantity:".addTranslation, + label: "Available Quantity".addTranslation, value: model.availablityQty?.toString() ?? '', ), ], - ).toShadowContainer( - context, - padding: 12, - showShadow: false, - ); + ).toShadowContainer(context); } } diff --git a/lib/modules/pm_module/ppm_wo/update_ppm/update_ppm.dart b/lib/modules/pm_module/ppm_wo/update_ppm/update_ppm.dart index e431d5de..f6be4486 100644 --- a/lib/modules/pm_module/ppm_wo/update_ppm/update_ppm.dart +++ b/lib/modules/pm_module/ppm_wo/update_ppm/update_ppm.dart @@ -45,7 +45,6 @@ class _UpdatePpmState extends State with TickerProviderStateMixin { TabController? _tabController; late PpmProvider ppmProvider; - _onSubmit({required int status}) async { if (ppmProvider.validate()) { showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading()); @@ -105,9 +104,6 @@ class _UpdatePpmState extends State with TickerProviderStateMixin { }); } - - - void initTabs(typeOfService) { if (typeOfService == null) { return; @@ -286,15 +282,13 @@ class _UpdatePpmState extends State with TickerProviderStateMixin { ] ], ), - 12.height, AppFilledButton( onPressed: () async { - Navigator.of(context).push(MaterialPageRoute(builder: (_) => const PmActivitiesListView())); - // getVisitData(); + Navigator.of(context).push(MaterialPageRoute(builder: (_) => const PmActivitiesListView())); }, buttonColor: AppColor.neutral50, - label: context.translation.activities, + label: "View Spare Parts", ), ], ), 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 91eafc9d..3b25ec42 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 @@ -106,6 +106,7 @@ class _WoInfoFormState extends State { IgnorePointer( ignoring: ppmProvider.isReadOnly, child: Column( + spacing: 12, children: [ Column( mainAxisSize: MainAxisSize.min, @@ -147,7 +148,6 @@ class _WoInfoFormState extends State { // '${context.translation.executionTimeFrame}: ${widget.planPreventiveVisit.executionTimeFrame ?? ""} days'.bodyText2(context).custom(color: AppColor.neutral120), ], ).toShadowContainer(context), - 12.height, Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, @@ -221,9 +221,10 @@ class _WoInfoFormState extends State { // } // }, // ), - 8.height, + // 8.height,// Column( mainAxisAlignment: MainAxisAlignment.start, + spacing: 12, children: [ SingleItemDropDownMenu( context: context, @@ -238,7 +239,6 @@ class _WoInfoFormState extends State { } }, ), - 8.height, ADatePicker( label: context.translation.actualVisit, hideShadow: true, @@ -285,8 +285,6 @@ class _WoInfoFormState extends State { // } // }, // ), - - 8.height, SingleItemDropDownMenu( context: context, backgroundColor: AppColor.fieldBgColor(context), @@ -299,7 +297,6 @@ class _WoInfoFormState extends State { } }, ), - 8.height, SingleItemDropDownMenu( context: context, backgroundColor: AppColor.fieldBgColor(context), @@ -314,7 +311,6 @@ class _WoInfoFormState extends State { } }, ), - 8.height, SingleItemDropDownMenu( context: context, backgroundColor: AppColor.fieldBgColor(context), @@ -335,9 +331,7 @@ class _WoInfoFormState extends State { } }, ), - 8.height, _timerWidget(context, totalWorkingHours), - 8.height, AppTextFormField( labelText: context.translation.comment, backgroundColor: AppColor.fieldBgColor(context), @@ -349,7 +343,6 @@ class _WoInfoFormState extends State { widget.planPreventiveVisit.comments = value; }, ), - 16.height, AttachmentPicker( label: context.translation.attachments, attachment: ppmProvider.ppmPlanAttachments, @@ -359,7 +352,6 @@ class _WoInfoFormState extends State { ), ], ).toShadowContainer(context), - 16.height, costCard(context, ppmProvider), ], ), @@ -417,6 +409,7 @@ class _WoInfoFormState extends State { Widget _timerWidget(BuildContext context, double totalWorkingHours) { return Column( + spacing: 12, children: [ AppTimer( label: context.translation.workingHours, @@ -438,7 +431,6 @@ class _WoInfoFormState extends State { return true; }, ), - 11.height, if (totalWorkingHours > 0.0) ...[ WorkingTimeTile( timerList: timerList, diff --git a/lib/views/widgets/timer/app_timer.dart b/lib/views/widgets/timer/app_timer.dart index d33b0274..759a9c17 100644 --- a/lib/views/widgets/timer/app_timer.dart +++ b/lib/views/widgets/timer/app_timer.dart @@ -158,6 +158,7 @@ class _AppTimerState extends State { @override Widget build(BuildContext context) { return Column( + spacing: 12, children: [ if (canPickTime) ...[ Row( @@ -228,7 +229,6 @@ class _AppTimerState extends State { ], ), if (_tempPickerTimer != null) ...[ - 8.height, Row( children: [ Column( @@ -248,7 +248,7 @@ class _AppTimerState extends State { ], ).toShadowContainer(context) ], - 8.height, + // 8.height, ], if (widget.showTimer) Container(