refactor : inspection

This commit is contained in:
2025-09-27 09:35:00 +03:30
parent a7c7442b49
commit d9a18c968b
14 changed files with 85 additions and 51 deletions

View File

@@ -2,9 +2,11 @@ import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/models/response/hatching/hatching_models.dart';
import 'package:rasadyar_chicken/data/models/response/hatching_report/hatching_report.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/logic.dart';
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
import 'package:rasadyar_core/core.dart';
class InspectionPoultryScienceLogic extends GetxController {
BaseLogic baseLogic = Get.find<BaseLogic>();
Rx<Resource<PaginationModel<HatchingModel>>> hatchingList =
Resource<PaginationModel<HatchingModel>>.loading().obs;
@@ -41,6 +43,8 @@ class InspectionPoultryScienceLogic extends GetxController {
routesName.removeLast();
routesName.add(callback == 0 ? 'بازرسی' : 'بایگانی');
});
}
@override
@@ -63,7 +67,9 @@ class InspectionPoultryScienceLogic extends GetxController {
@override
void onClose() {
// TODO: implement onClose
baseLogic.isSearchSelected.value=false;
baseLogic.textEditingController.clear();
baseLogic.searchValue.value=null;
super.onClose();
}
@@ -247,8 +253,9 @@ class InspectionPoultryScienceLogic extends GetxController {
}
void setSearchValue(String? data) {
dLog('Search Value: $data');
searchedValue.value = data?.trim();
final isReporter = selectedSegmentIndex.value == 0;
final isReporter = selectedSegmentIndex.value == 1;
if (isReporter) {
getHatchingReport();
} else {
@@ -256,3 +263,4 @@ class InspectionPoultryScienceLogic extends GetxController {
}
}
}

View File

@@ -18,12 +18,12 @@ class InspectionPoultrySciencePage extends GetView<InspectionPoultryScienceLogic
hasBack: true,
hasFilter: true,
hasSearch: true,
filteringWidget: filterBottomSheet(),
onFilterTap: () {
Get.bottomSheet(filterBottomSheet());
},
onSearchChanged: (data) => controller.setSearchValue(data),
backId: poultryFirstKey,
routes: controller.routesName,
//routesWidget: ObxValue((route) => buildContainerPageRoute(route), controller.routesName),
widgets: [
SizedBox(height: 50, child: segmentWidget()),
ObxValue((data) {