feat: new ui changes
This commit is contained in:
@@ -2,7 +2,6 @@ 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 {
|
||||
@@ -43,8 +42,6 @@ class InspectionPoultryScienceLogic extends GetxController {
|
||||
routesName.removeLast();
|
||||
routesName.add(callback == 0 ? 'بازرسی' : 'بایگانی');
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -71,7 +68,6 @@ class InspectionPoultryScienceLogic extends GetxController {
|
||||
baseLogic.clearSearch();
|
||||
}
|
||||
|
||||
|
||||
Future<void> getHatchingList([bool isLoadingMore = false]) async {
|
||||
if (isLoadingMore) {
|
||||
isLoadingMoreAllocationsMade.value = true;
|
||||
@@ -261,5 +257,10 @@ class InspectionPoultryScienceLogic extends GetxController {
|
||||
getHatchingList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> onRefresh() async {
|
||||
currentPage.value = 1;
|
||||
|
||||
await Future.wait([getHatchingList(), getHatchingReport()]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,15 +21,18 @@ class InspectionPoultrySciencePage extends GetView<InspectionPoultryScienceLogic
|
||||
onFilterTap: () {
|
||||
Get.bottomSheet(filterBottomSheet());
|
||||
},
|
||||
onRefresh: controller.onRefresh,
|
||||
onSearchChanged: (data) => controller.setSearchValue(data),
|
||||
backId: poultryFirstKey,
|
||||
routesWidget: ContainerBreadcrumb(rxRoutes: controller.routesName),
|
||||
widgets: [
|
||||
SizedBox(height: 50, child: segmentWidget()),
|
||||
ObxValue((data) {
|
||||
return data.value == 0 ? hatchingWidget() : reportWidget();
|
||||
}, controller.selectedSegmentIndex),
|
||||
],
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 50, child: segmentWidget()),
|
||||
ObxValue((data) {
|
||||
return data.value == 0 ? hatchingWidget() : reportWidget();
|
||||
}, controller.selectedSegmentIndex),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -60,10 +63,6 @@ class InspectionPoultrySciencePage extends GetView<InspectionPoultryScienceLogic
|
||||
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),
|
||||
);
|
||||
@@ -356,10 +355,6 @@ class InspectionPoultrySciencePage extends GetView<InspectionPoultryScienceLogic
|
||||
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),
|
||||
);
|
||||
@@ -518,7 +513,8 @@ class InspectionPoultrySciencePage extends GetView<InspectionPoultryScienceLogic
|
||||
item.image?[index] ?? '',
|
||||
loadingBuilder: (context, child, loadingProgress) {
|
||||
if (loadingProgress == null) return child;
|
||||
return Padding(padding: EdgeInsetsGeometry.all(80),
|
||||
return Padding(
|
||||
padding: EdgeInsetsGeometry.all(80),
|
||||
|
||||
child: CircularProgressIndicator(
|
||||
color: AppColor.blueDark,
|
||||
|
||||
Reference in New Issue
Block a user