From 3649d82ccc37f0f2707c642c717486f1af856b72 Mon Sep 17 00:00:00 2001 From: "mr.mojtaba" Date: Sat, 13 Sep 2025 11:41:53 +0330 Subject: [PATCH] fix : inspection -> poultry science --- .../pages/poultry_science/farm/view.dart | 1 + .../poultry_science/inspection/view.dart | 152 +++++++++--------- .../lib/presentation/routes/pages.dart | 1 + 3 files changed, 79 insertions(+), 75 deletions(-) diff --git a/packages/chicken/lib/presentation/pages/poultry_science/farm/view.dart b/packages/chicken/lib/presentation/pages/poultry_science/farm/view.dart index 5d6ca9d..41eb9b7 100644 --- a/packages/chicken/lib/presentation/pages/poultry_science/farm/view.dart +++ b/packages/chicken/lib/presentation/pages/poultry_science/farm/view.dart @@ -14,6 +14,7 @@ class FarmPage extends GetView { routes: controller.routes, hasFilter: false, hasSearch: false, + onBackPressed: () => Get.back(id:0), widgets: [firstTagInformation(), farmListWidget()], ); } diff --git a/packages/chicken/lib/presentation/pages/poultry_science/inspection/view.dart b/packages/chicken/lib/presentation/pages/poultry_science/inspection/view.dart index 468f350..30b7e87 100644 --- a/packages/chicken/lib/presentation/pages/poultry_science/inspection/view.dart +++ b/packages/chicken/lib/presentation/pages/poultry_science/inspection/view.dart @@ -29,40 +29,40 @@ class InspectionPoultrySciencePage extends GetView>>> hatchingWidget() { - return ObxValue((data) { - return RPaginatedListView( - listType: ListType.separated, - resource: data.value, - hasMore: data.value.data?.next != null, - padding: EdgeInsets.fromLTRB(8, 8, 8, 80), - itemBuilder: (context, index) { - var item = data.value.data!.results![index]; - return ObxValue((val) { - return ExpandableListItem2( - selected: val.contains(index), - onTap: () => controller.isExpandedList.toggle(index), - index: index, - child: itemListWidget(item), - secondChild: itemListExpandedWidget(item), - labelColor: AppColor.blueLight, - labelIcon: Assets.vec.checkSquareSvg.path, - ); - }, controller.isExpandedList); - }, - itemCount: data.value.data?.results?.length ?? 0, - separatorBuilder: (context, index) => SizedBox(height: 8.h), - onLoadMore: () async => controller.getHatchingList(true), - onRefresh: () async { - controller.currentPage.value = 1; - await controller.getHatchingList(); - }, - ); - }, controller.hatchingList); + Widget hatchingWidget() { + return Expanded( + child: ObxValue((data) { + return RPaginatedListView( + listType: ListType.separated, + resource: data.value, + hasMore: data.value.data?.next != null, + padding: EdgeInsets.fromLTRB(8, 8, 8, 80), + itemBuilder: (context, index) { + var item = data.value.data!.results![index]; + return ObxValue((val) { + return ExpandableListItem2( + selected: val.contains(index), + onTap: () => controller.isExpandedList.toggle(index), + index: index, + child: itemListWidget(item), + secondChild: itemListExpandedWidget(item), + labelColor: AppColor.blueLight, + labelIcon: Assets.vec.checkSquareSvg.path, + ); + }, controller.isExpandedList); + }, + itemCount: data.value.data?.results?.length ?? 0, + separatorBuilder: (context, index) => SizedBox(height: 8.h), + onLoadMore: () async => controller.getHatchingList(true), + onRefresh: () async { + controller.currentPage.value = 1; + await controller.getHatchingList(); + }, + ); + }, controller.hatchingList), + ); } - - Container itemListExpandedWidget(HatchingModel item) { return Container( padding: EdgeInsets.symmetric(horizontal: 8), @@ -135,8 +135,8 @@ class InspectionPoultrySciencePage extends GetView controller.isExpandedList.toggle(index), - index: index, - child: itemListWidgetReport(item), - secondChild: itemListExpandedWidgetReport(item), - labelColor: AppColor.blueLight, - labelIcon: Assets.vec.checkSquareSvg.path, - ); - }, controller.isExpandedList); - }, - itemCount: data.value.data?.results?.length ?? 0, - separatorBuilder: (context, index) => SizedBox(height: 8.h), - onLoadMore: () async => controller.getHatchingReport(true), - onRefresh: () async { - controller.currentPage.value = 1; - await controller.getHatchingReport(); - }, - ); - }, controller.hatchingReportList); + return Expanded( + child: ObxValue((data) { + return RPaginatedListView( + listType: ListType.separated, + resource: data.value, + hasMore: data.value.data?.next != null, + padding: EdgeInsets.fromLTRB(8, 8, 8, 80), + itemBuilder: (context, index) { + var item = data.value.data!.results![index]; + return ObxValue((val) { + return ExpandableListItem2( + selected: val.contains(index), + onTap: () => controller.isExpandedList.toggle(index), + index: index, + child: itemListWidgetReport(item), + secondChild: itemListExpandedWidgetReport(item), + labelColor: AppColor.blueLight, + labelIcon: Assets.vec.checkSquareSvg.path, + ); + }, controller.isExpandedList); + }, + itemCount: data.value.data?.results?.length ?? 0, + separatorBuilder: (context, index) => SizedBox(height: 8.h), + onLoadMore: () async => controller.getHatchingReport(true), + onRefresh: () async { + controller.currentPage.value = 1; + await controller.getHatchingReport(); + }, + ); + }, controller.hatchingReportList), + ); } Widget itemListExpandedWidgetReport(HatchingReport item) { @@ -398,14 +400,14 @@ class InspectionPoultrySciencePage extends GetView InspectionPoultryScienceLogic()); + Get.lazyPut(() => SearchLogic()); }), ), GetPage(