From efd6a9bf9f0f143789c16a574107166762eafd2f Mon Sep 17 00:00:00 2001 From: "mr.mojtaba" Date: Wed, 17 Dec 2025 09:22:21 +0330 Subject: [PATCH] feat: enhance CreateInspectionBottomSheetLogic by resetting critical values during initialization and improving UI responsiveness with updated height adjustments and location visibility --- .../create_inspection_bottom_sheet_logic.dart | 14 +++++++++---- .../step1_page.dart | 21 +++++++++++++++++-- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/packages/chicken/lib/features/poultry_science/presentation/widgets/submit_inspection_bottom_sheet/create_inspection_bottom_sheet_logic.dart b/packages/chicken/lib/features/poultry_science/presentation/widgets/submit_inspection_bottom_sheet/create_inspection_bottom_sheet_logic.dart index 341551d..c1bec90 100644 --- a/packages/chicken/lib/features/poultry_science/presentation/widgets/submit_inspection_bottom_sheet/create_inspection_bottom_sheet_logic.dart +++ b/packages/chicken/lib/features/poultry_science/presentation/widgets/submit_inspection_bottom_sheet/create_inspection_bottom_sheet_logic.dart @@ -210,10 +210,6 @@ class CreateInspectionBottomSheetLogic extends GetxController void onReady() { super.onReady(); activeStepperIndex.listen((value) { - iLog("==========>$value"); - if (value == 1) { - setUpPultryImagesListener(); - } pageController.animateToPage( value, duration: Duration(milliseconds: 300), @@ -374,6 +370,13 @@ class CreateInspectionBottomSheetLogic extends GetxController } void initData() { + // Reset critical values before initializing + currentLocation.value = null; + nextStepButtonEnabled.value = false; + activeStepperIndex.value = 0; + selectedTabIndex.value = 0; + isLoadingLocation.value = false; + submitInspectionResponse = SubmitInspectionResponse( generalConditionHall: GeneralConditionHall(), casualties: Casualties(), @@ -440,7 +443,10 @@ class CreateInspectionBottomSheetLogic extends GetxController } void setHatchingModel(HatchingModel hatchingModel) { + // Reset all data before setting new hatching model + resetAllData(); this.hatchingModel = hatchingModel; + initData(); } void changeSegmentIndex(int index) { diff --git a/packages/chicken/lib/features/poultry_science/presentation/widgets/submit_inspection_bottom_sheet/step1_page.dart b/packages/chicken/lib/features/poultry_science/presentation/widgets/submit_inspection_bottom_sheet/step1_page.dart index a1dc1ff..c8883a2 100644 --- a/packages/chicken/lib/features/poultry_science/presentation/widgets/submit_inspection_bottom_sheet/step1_page.dart +++ b/packages/chicken/lib/features/poultry_science/presentation/widgets/submit_inspection_bottom_sheet/step1_page.dart @@ -1,3 +1,4 @@ +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:rasadyar_chicken/features/poultry_science/presentation/widgets/submit_inspection_bottom_sheet/card_info.dart'; @@ -13,8 +14,8 @@ Widget step1Page(CreateInspectionBottomSheetLogic controller) { Container( height: controller.tenantStatusController.text == 'دارد' - ? 600.h - : 460.h, + ? 605.h + : 470.h, clipBehavior: Clip.none, width: Get.width, child: farmInfoWidget( @@ -163,6 +164,22 @@ Column basicUnitInformation(CreateInspectionBottomSheetLogic controller) { ), ), ), + + ObxValue((data) { + return Visibility( + visible: data.value != null, + child: Row( + spacing: 8, + children: [ + Icon(Icons.gps_fixed, color: AppColor.greenNormal, size: 24), + Text( + 'موقعیت جغرافیایی دریافت شد', + style: AppFonts.yekan12.copyWith(color: AppColor.greenNormal), + ), + ], + ), + ); + }, controller.currentLocation), ], ); }