refactor : inspection
This commit is contained in:
@@ -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 {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user