feat: enhance CreateInspectionBottomSheetLogic by resetting critical values during initialization and improving UI responsiveness with updated height adjustments and location visibility
This commit is contained in:
@@ -210,10 +210,6 @@ class CreateInspectionBottomSheetLogic extends GetxController
|
|||||||
void onReady() {
|
void onReady() {
|
||||||
super.onReady();
|
super.onReady();
|
||||||
activeStepperIndex.listen((value) {
|
activeStepperIndex.listen((value) {
|
||||||
iLog("==========>$value");
|
|
||||||
if (value == 1) {
|
|
||||||
setUpPultryImagesListener();
|
|
||||||
}
|
|
||||||
pageController.animateToPage(
|
pageController.animateToPage(
|
||||||
value,
|
value,
|
||||||
duration: Duration(milliseconds: 300),
|
duration: Duration(milliseconds: 300),
|
||||||
@@ -374,6 +370,13 @@ class CreateInspectionBottomSheetLogic extends GetxController
|
|||||||
}
|
}
|
||||||
|
|
||||||
void initData() {
|
void initData() {
|
||||||
|
// Reset critical values before initializing
|
||||||
|
currentLocation.value = null;
|
||||||
|
nextStepButtonEnabled.value = false;
|
||||||
|
activeStepperIndex.value = 0;
|
||||||
|
selectedTabIndex.value = 0;
|
||||||
|
isLoadingLocation.value = false;
|
||||||
|
|
||||||
submitInspectionResponse = SubmitInspectionResponse(
|
submitInspectionResponse = SubmitInspectionResponse(
|
||||||
generalConditionHall: GeneralConditionHall(),
|
generalConditionHall: GeneralConditionHall(),
|
||||||
casualties: Casualties(),
|
casualties: Casualties(),
|
||||||
@@ -440,7 +443,10 @@ class CreateInspectionBottomSheetLogic extends GetxController
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setHatchingModel(HatchingModel hatchingModel) {
|
void setHatchingModel(HatchingModel hatchingModel) {
|
||||||
|
// Reset all data before setting new hatching model
|
||||||
|
resetAllData();
|
||||||
this.hatchingModel = hatchingModel;
|
this.hatchingModel = hatchingModel;
|
||||||
|
initData();
|
||||||
}
|
}
|
||||||
|
|
||||||
void changeSegmentIndex(int index) {
|
void changeSegmentIndex(int index) {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:rasadyar_chicken/features/poultry_science/presentation/widgets/submit_inspection_bottom_sheet/card_info.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(
|
Container(
|
||||||
height: controller.tenantStatusController.text == 'دارد'
|
height: controller.tenantStatusController.text == 'دارد'
|
||||||
? 600.h
|
? 605.h
|
||||||
: 460.h,
|
: 470.h,
|
||||||
clipBehavior: Clip.none,
|
clipBehavior: Clip.none,
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
child: farmInfoWidget(
|
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),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user