feat: integrate city poultry feature by adding routes, DI setup, and updating UI components to reflect new data handling and localization changes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:rasadyar_chicken/features/city_jahad/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/features/province_inspector/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/features/province_operator/presentation/routes/routes.dart';
|
||||
@@ -149,7 +150,7 @@ Map<String, String?> getFaUserRoleWithOnTap(String? role) {
|
||||
case "Dispenser":
|
||||
return {"پخش کننده": null};
|
||||
case "CityPoultry":
|
||||
return {"طیور شهرستان": null};
|
||||
return {"طیور شهرستان": CityPoultryRoutes.initCityPoultry};
|
||||
case "ParentCompany":
|
||||
return {"شرکت مادر": null};
|
||||
case "ColdHouseSteward":
|
||||
|
||||
@@ -10,6 +10,7 @@ import 'package:rasadyar_chicken/features/steward/data/di/steward_di.dart';
|
||||
import 'package:rasadyar_chicken/features/province_operator/data/di/province_operator_di.dart';
|
||||
import 'package:rasadyar_chicken/features/province_inspector/data/di/province_inspector_di.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/data/di/city_jahad_di.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/data/di/city_poultry_di.dart';
|
||||
import 'package:rasadyar_chicken/features/vet_farm/data/di/vet_farm_di.dart';
|
||||
import 'package:rasadyar_chicken/features/super_admin/data/di/super_admin_di.dart';
|
||||
import 'package:rasadyar_chicken/features/province_supervisor/data/di/province_supervisor_di.dart';
|
||||
@@ -74,6 +75,9 @@ Future<void> setupChickenDI() async {
|
||||
// Setup city_jahad feature DI
|
||||
await setupCityJahadDI(diChicken, dioRemote);
|
||||
|
||||
// Setup city_poultry feature DI
|
||||
await setupCityPoultryDI(diChicken, dioRemote);
|
||||
|
||||
// Setup vet_farm feature DI
|
||||
await setupVetFarmDI(diChicken, dioRemote);
|
||||
|
||||
@@ -138,6 +142,7 @@ Future<void> newSetupAuthDI(String newUrl) async {
|
||||
await setupProvinceOperatorDI(diChicken, dioRemote);
|
||||
await setupProvinceInspectorDI(diChicken, dioRemote);
|
||||
await setupCityJahadDI(diChicken, dioRemote);
|
||||
await setupCityPoultryDI(diChicken, dioRemote);
|
||||
await setupVetFarmDI(diChicken, dioRemote);
|
||||
await setupSuperAdminDI(diChicken, dioRemote);
|
||||
await setupProvinceSupervisorDI(diChicken, dioRemote);
|
||||
|
||||
@@ -193,12 +193,12 @@ class ActiveHatchingPage extends GetView<ActiveHatchingLogic> {
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.user?.fullname ?? 'N/A',
|
||||
item.poultry?.user?.fullname ?? 'ندارد',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.user?.mobile ?? 'N/A',
|
||||
item.poultry?.user?.mobile ?? 'ندارد',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
@@ -213,12 +213,12 @@ class ActiveHatchingPage extends GetView<ActiveHatchingLogic> {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.unitName ?? 'N/A',
|
||||
item.poultry?.unitName ?? 'ندارد',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.licenceNumber ?? 'N/A',
|
||||
item.licenceNumber ?? 'ندارد',
|
||||
textAlign: TextAlign.left,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
|
||||
@@ -23,7 +23,7 @@ class CityJahadHomeLogic extends GetxController {
|
||||
CityJahadActionItem(
|
||||
title: "بازرسی مزارع طیور",
|
||||
route: CityJahadRoutes.newInspectionCityJahad,
|
||||
icon: Assets.vec.activeFramSvg.path,
|
||||
icon: Assets.vec.inspectionPoultrySvg.path,
|
||||
),
|
||||
].obs;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export 'data/di/city_poultry_di.dart';
|
||||
export 'presentation/routes/routes.dart';
|
||||
export 'presentation/routes/pages.dart';
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/response/poultry_science_report/poultry_science_report.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/request/submit_inspection/submit_inspection_response.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
abstract class CityPoultryRemoteDataSource {
|
||||
Future<PaginationModel<PoultryScienceReport>?> getSubmitInspectionList({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<void> submitInspection({
|
||||
required String token,
|
||||
required SubmitInspectionResponse request,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/response/poultry_science_report/poultry_science_report.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/request/submit_inspection/submit_inspection_response.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/data/datasources/remote/city_poultry_remote_data_source.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class CityPoultryRemoteDataSourceImpl implements CityPoultryRemoteDataSource {
|
||||
final DioRemote _httpClient;
|
||||
|
||||
CityPoultryRemoteDataSourceImpl(this._httpClient);
|
||||
|
||||
@override
|
||||
Future<PaginationModel<PoultryScienceReport>?> getSubmitInspectionList({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/poultry_science_report/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
queryParameters: queryParameters,
|
||||
fromJson: (json) => PaginationModel<PoultryScienceReport>.fromJson(
|
||||
json,
|
||||
(json) => PoultryScienceReport.fromJson(json as Map<String, dynamic>),
|
||||
),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> submitInspection({
|
||||
required String token,
|
||||
required SubmitInspectionResponse request,
|
||||
}) async {
|
||||
await _httpClient.post(
|
||||
'/poultry_science_report/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
data: request.toJson(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
import 'package:rasadyar_chicken/features/city_poultry/data/datasources/remote/city_poultry_remote_data_source.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/data/datasources/remote/city_poultry_remote_data_source_impl.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/data/repositories/city_poultry_repository.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/data/repositories/city_poultry_repository_impl.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
/// Setup dependency injection for city_poultry feature
|
||||
Future<void> setupCityPoultryDI(GetIt di, DioRemote dioRemote) async {
|
||||
di.registerLazySingleton<CityPoultryRemoteDataSource>(
|
||||
() => CityPoultryRemoteDataSourceImpl(dioRemote),
|
||||
);
|
||||
|
||||
di.registerLazySingleton<CityPoultryRepository>(
|
||||
() => CityPoultryRepositoryImpl(di.get<CityPoultryRemoteDataSource>()),
|
||||
);
|
||||
}
|
||||
|
||||
/// Re-register city_poultry dependencies (used when base URL changes)
|
||||
Future<void> reRegisterCityPoultryDI(GetIt di, DioRemote dioRemote) async {
|
||||
await reRegister(di, () => CityPoultryRemoteDataSourceImpl(dioRemote));
|
||||
await reRegister(
|
||||
di,
|
||||
() => CityPoultryRepositoryImpl(di.get<CityPoultryRemoteDataSource>()),
|
||||
);
|
||||
}
|
||||
|
||||
/// Helper function to re-register a dependency
|
||||
Future<void> reRegister<T extends Object>(
|
||||
GetIt di,
|
||||
T Function() factory,
|
||||
) async {
|
||||
if (di.isRegistered<T>()) {
|
||||
await di.unregister<T>();
|
||||
}
|
||||
di.registerLazySingleton<T>(factory);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/response/poultry_science_report/poultry_science_report.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/request/submit_inspection/submit_inspection_response.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
abstract class CityPoultryRepository {
|
||||
Future<PaginationModel<PoultryScienceReport>?> getSubmitInspectionList({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<void> submitInspection({
|
||||
required String token,
|
||||
required SubmitInspectionResponse request,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/response/poultry_science_report/poultry_science_report.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/request/submit_inspection/submit_inspection_response.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/data/datasources/remote/city_poultry_remote_data_source.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/data/repositories/city_poultry_repository.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class CityPoultryRepositoryImpl implements CityPoultryRepository {
|
||||
final CityPoultryRemoteDataSource _remote;
|
||||
|
||||
CityPoultryRepositoryImpl(this._remote);
|
||||
|
||||
@override
|
||||
Future<PaginationModel<PoultryScienceReport>?> getSubmitInspectionList({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
return await _remote.getSubmitInspectionList(
|
||||
token: token,
|
||||
queryParameters: queryParameters,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> submitInspection({
|
||||
required String token,
|
||||
required SubmitInspectionResponse request,
|
||||
}) async {
|
||||
return await _remote.submitInspection(token: token, request: request);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/response/hatching/hatching_models.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/repositories/poultry_science_repository.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/presentation/pages/root/logic.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class ActiveHatchingLogic extends GetxController {
|
||||
CityPoultryRootLogic rootLogic = Get.find<CityPoultryRootLogic>();
|
||||
BaseLogic baseLogic = Get.find<BaseLogic>();
|
||||
late PoultryScienceRepository poultryScienceRepository;
|
||||
Rx<Resource<PaginationModel<HatchingModel>>> activeHatchingList =
|
||||
Resource<PaginationModel<HatchingModel>>.loading().obs;
|
||||
|
||||
final RxBool isLoadingMoreList = false.obs;
|
||||
RxInt currentPage = 1.obs;
|
||||
RxInt expandedIndex = RxInt(-1);
|
||||
List<String> routesName = ['اقدام', 'جوجه ریزی فعال'];
|
||||
|
||||
Rx<Jalali> fromDateFilter = Jalali.now().obs;
|
||||
Rx<Jalali> toDateFilter = Jalali.now().obs;
|
||||
RxnString searchedValue = RxnString();
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
poultryScienceRepository = diChicken.get<PoultryScienceRepository>();
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
getHatchingList();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
super.onClose();
|
||||
baseLogic.clearSearch();
|
||||
}
|
||||
|
||||
Future<void> getHatchingList([bool isLoadingMore = false]) async {
|
||||
if (isLoadingMore) {
|
||||
isLoadingMoreList.value = true;
|
||||
} else {
|
||||
activeHatchingList.value =
|
||||
Resource<PaginationModel<HatchingModel>>.loading();
|
||||
}
|
||||
|
||||
if (searchedValue.value != null &&
|
||||
searchedValue.value!.trim().isNotEmpty &&
|
||||
currentPage.value > 1) {
|
||||
currentPage.value = 1;
|
||||
}
|
||||
|
||||
safeCall(
|
||||
call: () async => await poultryScienceRepository.getHatchingPoultry(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
queryParameters: buildQueryParams(
|
||||
queryParams: {'type': 'hatching'},
|
||||
role: 'CityPoultry',
|
||||
pageSize: 50,
|
||||
page: currentPage.value,
|
||||
),
|
||||
),
|
||||
onSuccess: (res) {
|
||||
if ((res?.count ?? 0) == 0) {
|
||||
activeHatchingList.value =
|
||||
Resource<PaginationModel<HatchingModel>>.empty();
|
||||
} else {
|
||||
activeHatchingList.value =
|
||||
Resource<PaginationModel<HatchingModel>>.success(
|
||||
PaginationModel<HatchingModel>(
|
||||
count: res?.count ?? 0,
|
||||
next: res?.next,
|
||||
previous: res?.previous,
|
||||
results: [
|
||||
...(activeHatchingList.value.data?.results ?? []),
|
||||
...(res?.results ?? []),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void toggleExpanded(int index) {
|
||||
expandedIndex.value = expandedIndex.value == index ? -1 : index;
|
||||
}
|
||||
|
||||
Future<void> onRefresh() async {
|
||||
currentPage.value = 1;
|
||||
await getHatchingList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,236 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/response/hatching/hatching_models.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/presentation/pages/active_hatching/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/presentation/widgets/submit_inspection_bottom_sheet/create_inspection_bottom_sheet.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/presentation/widgets/submit_inspection_bottom_sheet/create_inspection_bottom_sheet_logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class ActiveHatchingPage extends GetView<ActiveHatchingLogic> {
|
||||
const ActiveHatchingPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ChickenBasePage(
|
||||
hasSearch: true,
|
||||
hasFilter: false,
|
||||
backId: cityPoultryActionKey,
|
||||
routes: controller.routesName,
|
||||
onSearchChanged: (data) {
|
||||
controller.searchedValue.value = data;
|
||||
controller.getHatchingList();
|
||||
},
|
||||
child: hatchingWidget(),
|
||||
);
|
||||
}
|
||||
|
||||
Widget 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.value.isEqual(index),
|
||||
onTap: () => controller.toggleExpanded(index),
|
||||
index: index,
|
||||
child: itemListWidget(item),
|
||||
secondChild: itemListExpandedWidget(item),
|
||||
labelColor: AppColor.blueLight,
|
||||
labelIcon: Assets.vec.activeFramSvg.path,
|
||||
);
|
||||
}, controller.expandedIndex);
|
||||
},
|
||||
itemCount: data.value.data?.results?.length ?? 0,
|
||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||
onLoadMore: () async => controller.getHatchingList(true),
|
||||
);
|
||||
}, controller.activeHatchingList);
|
||||
}
|
||||
|
||||
Container itemListExpandedWidget(HatchingModel item) {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.user?.fullname ?? 'N/A',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.greenDark),
|
||||
),
|
||||
Spacer(),
|
||||
|
||||
Visibility(
|
||||
child: Text(
|
||||
item.violation == true ? 'پیگیری' : 'عادی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan10.copyWith(color: AppColor.redDark),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
height: 32,
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: AppColor.blueLightHover),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'نژاد:${item.breed?.first.breed ?? 'N/A'}',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
Text(
|
||||
' سن${item.age} (روز)',
|
||||
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
' دوره جوجه ریزی:${item.period}',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
buildRow(
|
||||
title: 'شماره مجوز جوجه ریزی',
|
||||
value: item.licenceNumber ?? 'N/A',
|
||||
),
|
||||
buildUnitRow(
|
||||
title: 'حجم جوجه ریزی',
|
||||
value: item.quantity.separatedByCommaFa,
|
||||
unit: '(قطعه)',
|
||||
),
|
||||
buildUnitRow(
|
||||
title: 'مانده در سالن',
|
||||
value: item.leftOver.separatedByCommaFa,
|
||||
unit: '(قطعه)',
|
||||
),
|
||||
buildUnitRow(
|
||||
title: 'تلفات',
|
||||
value: item.losses.separatedByCommaFa,
|
||||
unit: '(قطعه)',
|
||||
),
|
||||
buildRow(
|
||||
title: 'دامپزشک فارم',
|
||||
value:
|
||||
'${item.vetFarm?.vetFarmFullName}(${item.vetFarm?.vetFarmMobile})',
|
||||
),
|
||||
buildRow(
|
||||
title: 'شرح بازرسی',
|
||||
value: item.reportInfo?.image == false
|
||||
? 'ارسال تصویر جوجه ریزی فارم '
|
||||
: 'تکمیل شده',
|
||||
titleStyle: AppFonts.yekan14.copyWith(
|
||||
color: (item.reportInfo?.image ?? false)
|
||||
? AppColor.greenNormal
|
||||
: AppColor.redDark,
|
||||
),
|
||||
valueStyle: AppFonts.yekan14.copyWith(
|
||||
color: (item.reportInfo?.image ?? false)
|
||||
? AppColor.greenNormal
|
||||
: AppColor.redDark,
|
||||
),
|
||||
),
|
||||
|
||||
RElevated(
|
||||
height: 40.h,
|
||||
isFullWidth: true,
|
||||
onPressed: () {
|
||||
Get.find<CreateInspectionBottomSheetLogic>().setHatchingModel(
|
||||
item,
|
||||
);
|
||||
Get.bottomSheet(
|
||||
CreateInspectionBottomSheet(),
|
||||
isScrollControlled: true,
|
||||
ignoreSafeArea: false,
|
||||
).then((value) {
|
||||
if (Get.isRegistered<CreateInspectionBottomSheetLogic>()) {
|
||||
Get.find<CreateInspectionBottomSheetLogic>().clearForm();
|
||||
}
|
||||
});
|
||||
},
|
||||
child: Text('ثبت بازرسی'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget itemListWidget(HatchingModel item) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
SizedBox(width: 20),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.user?.fullname ?? 'ندارد',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.user?.mobile ?? 'ندارد',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Column(
|
||||
spacing: 3,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.unitName ?? 'ندارد',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
Text(
|
||||
item.licenceNumber ?? 'ندارد',
|
||||
textAlign: TextAlign.left,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Assets.vec.scanSvg.svg(
|
||||
width: 32.w,
|
||||
height: 32.h,
|
||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import 'package:rasadyar_chicken/features/city_poultry/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class CityPoultryActionItem {
|
||||
final String title;
|
||||
final String route;
|
||||
final String icon;
|
||||
|
||||
CityPoultryActionItem({
|
||||
required this.title,
|
||||
required this.route,
|
||||
required this.icon,
|
||||
});
|
||||
}
|
||||
|
||||
class CityPoultryHomeLogic extends GetxController {
|
||||
RxList<CityPoultryActionItem> items = [
|
||||
CityPoultryActionItem(
|
||||
title: "جوجه ریزی فعال",
|
||||
route: CityPoultryRoutes.activeHatchingCityPoultry,
|
||||
icon: Assets.vec.activeFramSvg.path,
|
||||
),
|
||||
CityPoultryActionItem(
|
||||
title: "بازرسی مزارع طیور",
|
||||
route: CityPoultryRoutes.newInspectionCityPoultry,
|
||||
icon: Assets.vec.inspectionPoultrySvg.path,
|
||||
),
|
||||
].obs;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class CityPoultryHomePage extends GetView<CityPoultryHomeLogic> {
|
||||
CityPoultryHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ChickenBasePage(
|
||||
isBase: true,
|
||||
hasNews: true,
|
||||
hasNotification: true,
|
||||
child: gridWidget(),
|
||||
);
|
||||
}
|
||||
|
||||
Widget gridWidget() {
|
||||
return ObxValue((data) {
|
||||
return GridView.builder(
|
||||
physics: BouncingScrollPhysics(),
|
||||
padding: EdgeInsets.symmetric(vertical: 18.h, horizontal: 32.w),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
mainAxisSpacing: 24.h,
|
||||
crossAxisSpacing: 24.w,
|
||||
),
|
||||
itemCount: data.length,
|
||||
hitTestBehavior: HitTestBehavior.opaque,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var item = data[index];
|
||||
return GlassMorphismCardIcon(
|
||||
title: item.title,
|
||||
vecIcon: item.icon,
|
||||
onTap: () async {
|
||||
Get.toNamed(item.route, id: cityPoultryActionKey);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}, controller.items);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/presentation/pages/root/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/response/poultry_science_report/poultry_science_report.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/logic.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class NewInspectionLogic extends GetxController {
|
||||
BaseLogic baseLogic = Get.find<BaseLogic>();
|
||||
|
||||
Rx<Resource<PaginationModel<PoultryScienceReport>>> submitInspectionList =
|
||||
Resource<PaginationModel<PoultryScienceReport>>.loading().obs;
|
||||
|
||||
CityPoultryRootLogic rootLogic = Get.find<CityPoultryRootLogic>();
|
||||
|
||||
final RxBool isLoadingMoreAllocationsMade = false.obs;
|
||||
RxInt currentPage = 1.obs;
|
||||
RxInt expandedIndex = RxInt(-1);
|
||||
RxList<XFile> pickedImages = <XFile>[].obs;
|
||||
|
||||
RxBool isOnUpload = false.obs;
|
||||
|
||||
RxDouble presentUpload = 0.0.obs;
|
||||
RxList<String> routesName = RxList();
|
||||
RxInt selectedSegmentIndex = 0.obs;
|
||||
|
||||
RxnString searchedValue = RxnString();
|
||||
Rx<Jalali> fromDateFilter = Jalali.now().obs;
|
||||
Rx<Jalali> toDateFilter = Jalali.now().obs;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
|
||||
routesName.value = ['اقدام'].toList();
|
||||
|
||||
ever(selectedSegmentIndex, (callback) {
|
||||
routesName.removeLast();
|
||||
routesName.add(callback == 0 ? 'بازرسی' : 'بایگانی');
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
|
||||
getReport();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
super.onClose();
|
||||
baseLogic.clearSearch();
|
||||
}
|
||||
|
||||
Future<void> getReport([bool isLoadingMore = false]) async {
|
||||
if (isLoadingMore) {
|
||||
isLoadingMoreAllocationsMade.value = true;
|
||||
} else {
|
||||
submitInspectionList.value =
|
||||
Resource<PaginationModel<PoultryScienceReport>>.loading();
|
||||
}
|
||||
|
||||
if (searchedValue.value != null &&
|
||||
searchedValue.value!.trim().isNotEmpty &&
|
||||
currentPage.value > 1) {
|
||||
currentPage.value = 1;
|
||||
}
|
||||
|
||||
safeCall(
|
||||
call: () async =>
|
||||
await rootLogic.cityPoultryRepository.getSubmitInspectionList(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
queryParameters: buildQueryParams(
|
||||
role: 'CityPoultry',
|
||||
pageSize: 50,
|
||||
search: 'filter',
|
||||
|
||||
page: currentPage.value,
|
||||
),
|
||||
),
|
||||
onSuccess: (res) {
|
||||
if ((res?.count ?? 0) == 0) {
|
||||
submitInspectionList.value =
|
||||
Resource<PaginationModel<PoultryScienceReport>>.empty();
|
||||
} else {
|
||||
submitInspectionList.value =
|
||||
Resource<PaginationModel<PoultryScienceReport>>.success(
|
||||
PaginationModel<PoultryScienceReport>(
|
||||
count: res?.count ?? 0,
|
||||
next: res?.next,
|
||||
previous: res?.previous,
|
||||
results: [
|
||||
...(submitInspectionList.value.data?.results ?? []),
|
||||
...(res?.results ?? []),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> pickImages() async {
|
||||
determineCurrentPosition();
|
||||
var tmp = await pickCameraImage();
|
||||
if (tmp?.path != null && pickedImages.length < 7) {
|
||||
pickedImages.add(tmp!);
|
||||
}
|
||||
}
|
||||
|
||||
void removeImage(int index) {
|
||||
pickedImages.removeAt(index);
|
||||
}
|
||||
|
||||
void closeBottomSheet() {
|
||||
Get.back();
|
||||
}
|
||||
|
||||
double calculateUploadProgress({required int sent, required int total}) {
|
||||
if (total != 0) {
|
||||
double progress = (sent * 100 / total) / 100;
|
||||
return progress;
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void toggleExpanded(int index) {
|
||||
expandedIndex.value = expandedIndex.value == index ? -1 : index;
|
||||
}
|
||||
|
||||
void setSearchValue(String? data) {
|
||||
dLog('Search Value: $data');
|
||||
searchedValue.value = data?.trim();
|
||||
getReport();
|
||||
}
|
||||
|
||||
Future<void> onRefresh() async {
|
||||
currentPage.value = 1;
|
||||
await getReport();
|
||||
}
|
||||
|
||||
String getStatus(PoultryScienceReport item) {
|
||||
final status = item.reportInformation?.inspectionStatus ?? item.state;
|
||||
if (status == null || status.isEmpty) {
|
||||
return 'در حال بررسی';
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
Color getStatusColor(PoultryScienceReport item) {
|
||||
final status = item.reportInformation?.inspectionStatus ?? item.state;
|
||||
if (status == null || status.isEmpty) {
|
||||
return AppColor.yellowNormal;
|
||||
}
|
||||
// میتوانید منطق رنگ را بر اساس inspectionStatus تنظیم کنید
|
||||
return AppColor.greenNormal;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,100 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/data/repositories/city_poultry_repository.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/presentation/routes/pages.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/features/common/presentation/page/profile/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
enum ErrorLocationType { serviceDisabled, permissionDenied, none }
|
||||
|
||||
class CityPoultryRootLogic extends GetxController {
|
||||
var tokenService = Get.find<TokenStorageService>();
|
||||
|
||||
late CityPoultryRepository cityPoultryRepository;
|
||||
|
||||
RxList<ErrorLocationType> errorLocationType = RxList();
|
||||
RxMap<int, dynamic> homeExpandedList = RxMap();
|
||||
DateTime? _lastBackPressed;
|
||||
|
||||
RxInt currentPage = 0.obs;
|
||||
|
||||
final pages = [
|
||||
Navigator(
|
||||
key: Get.nestedKey(cityPoultryActionKey),
|
||||
onGenerateRoute: (settings) {
|
||||
final page = CityPoultryPages.pages.firstWhere(
|
||||
(e) => e.name == settings.name,
|
||||
orElse: () => CityPoultryPages.pages.firstWhere(
|
||||
(e) => e.name == CityPoultryRoutes.homeCityPoultry,
|
||||
),
|
||||
);
|
||||
|
||||
return buildRouteFromGetPage(page);
|
||||
},
|
||||
),
|
||||
|
||||
ProfilePage(),
|
||||
];
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
cityPoultryRepository = diChicken.get<CityPoultryRepository>();
|
||||
}
|
||||
|
||||
void toggleExpanded(int index) {
|
||||
if (homeExpandedList.keys.contains(index)) {
|
||||
homeExpandedList.remove(index);
|
||||
} else {
|
||||
homeExpandedList[index] = false;
|
||||
}
|
||||
}
|
||||
|
||||
void rootErrorHandler(DioException error) {
|
||||
handleGeneric(error, () {
|
||||
tokenService.deleteModuleTokens(Module.chicken);
|
||||
});
|
||||
}
|
||||
|
||||
void changePage(int index) {
|
||||
currentPage.value = index;
|
||||
}
|
||||
|
||||
void popBackTaped() async {
|
||||
final nestedKey = Get.nestedKey(cityPoultryActionKey);
|
||||
|
||||
final currentRoute = Get.routing.current;
|
||||
|
||||
// بررسی کن که آیا route فعلی یکی از routeهای داخلی است
|
||||
final isInternalRoute =
|
||||
currentRoute == CityPoultryRoutes.activeHatchingCityPoultry ||
|
||||
currentRoute == CityPoultryRoutes.newInspectionCityPoultry ||
|
||||
currentRoute == CityPoultryRoutes.actionCityPoultry;
|
||||
|
||||
// فقط اگر میتوان pop کرد و در یکی از صفحههای داخلی هستیم، pop کن
|
||||
if ( isInternalRoute) {
|
||||
Get.back(id: cityPoultryActionKey);
|
||||
return;
|
||||
}
|
||||
|
||||
// اگر در صفحه home هستیم، منطق خروج از اپ را اجرا کن
|
||||
final now = DateTime.now();
|
||||
if (_lastBackPressed == null ||
|
||||
now.difference(_lastBackPressed!) > Duration(seconds: 2)) {
|
||||
_lastBackPressed = now;
|
||||
Get.snackbar(
|
||||
'خروج از برنامه',
|
||||
'برای خروج دوباره بازگشت را بزنید',
|
||||
snackPosition: SnackPosition.TOP,
|
||||
duration: Duration(seconds: 2),
|
||||
backgroundColor: AppColor.warning,
|
||||
);
|
||||
} else {
|
||||
await SystemNavigator.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class CityPoultryRootPage extends GetView<CityPoultryRootLogic> {
|
||||
const CityPoultryRootPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ChickenBasePage(
|
||||
isFullScreen: true,
|
||||
onPopScopTaped: controller.popBackTaped,
|
||||
child: ObxValue((data) {
|
||||
return Stack(
|
||||
children: [
|
||||
IndexedStack(children: controller.pages, index: data.value),
|
||||
Positioned(
|
||||
right: 0,
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
child: RBottomNavigation(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
items: [
|
||||
|
||||
RBottomNavigationItem(
|
||||
label: 'خانه',
|
||||
icon: Assets.vec.homeSvg.path,
|
||||
isSelected: controller.currentPage.value == 0,
|
||||
onTap: () {
|
||||
Get.nestedKey(
|
||||
cityPoultryActionKey,
|
||||
)?.currentState?.popUntil((route) => route.isFirst);
|
||||
controller.changePage(0);
|
||||
},
|
||||
),
|
||||
RBottomNavigationItem(
|
||||
label: 'پروفایل',
|
||||
icon: Assets.vec.profileCircleSvg.path,
|
||||
isSelected: controller.currentPage.value == 1,
|
||||
onTap: () {
|
||||
Get.nestedKey(
|
||||
cityPoultryActionKey,
|
||||
)?.currentState?.popUntil((route) => route.isFirst);
|
||||
controller.changePage(1);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}, controller.currentPage),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
import 'package:rasadyar_chicken/features/city_poultry/presentation/pages/home/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/presentation/pages/home/view.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/presentation/pages/root/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/presentation/pages/root/view.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/presentation/pages/active_hatching/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/presentation/pages/active_hatching/view.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/presentation/pages/new_inspection/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/presentation/pages/new_inspection/view.dart';
|
||||
import 'package:rasadyar_chicken/features/city_poultry/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/presentation/widgets/submit_inspection_bottom_sheet/create_inspection_bottom_sheet_logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/routes/global_binding.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/logic.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class CityPoultryPages {
|
||||
CityPoultryPages._();
|
||||
|
||||
static List<GetPage> get pages => [
|
||||
GetPage(
|
||||
name: CityPoultryRoutes.initCityPoultry,
|
||||
page: () => CityPoultryRootPage(),
|
||||
middlewares: [AuthMiddleware()],
|
||||
bindings: [
|
||||
GlobalBinding(),
|
||||
BindingsBuilder(() {
|
||||
Get.lazyPut(() => ChickenBaseLogic(), fenix: true);
|
||||
Get.lazyPut(() => CityPoultryRootLogic());
|
||||
Get.lazyPut(() => CityPoultryHomeLogic());
|
||||
}),
|
||||
],
|
||||
),
|
||||
GetPage(
|
||||
name: CityPoultryRoutes.homeCityPoultry,
|
||||
page: () => CityPoultryHomePage(),
|
||||
middlewares: [AuthMiddleware()],
|
||||
binding: BindingsBuilder(() {
|
||||
Get.put(CityPoultryHomeLogic());
|
||||
Get.lazyPut(() => ChickenBaseLogic());
|
||||
}),
|
||||
),
|
||||
|
||||
GetPage(
|
||||
name: CityPoultryRoutes.activeHatchingCityPoultry,
|
||||
page: () => ActiveHatchingPage(),
|
||||
middlewares: [AuthMiddleware()],
|
||||
bindings: [
|
||||
GlobalBinding(),
|
||||
BindingsBuilder(() {
|
||||
Get.lazyPut(() => ActiveHatchingLogic());
|
||||
Get.lazyPut(() => CreateInspectionBottomSheetLogic());
|
||||
}),
|
||||
],
|
||||
),
|
||||
GetPage(
|
||||
name: CityPoultryRoutes.newInspectionCityPoultry,
|
||||
page: () => NewInspectionPage(),
|
||||
middlewares: [AuthMiddleware()],
|
||||
bindings: [
|
||||
GlobalBinding(),
|
||||
BindingsBuilder(() {
|
||||
Get.lazyPut(() => NewInspectionLogic());
|
||||
}),
|
||||
],
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
sealed class CityPoultryRoutes {
|
||||
CityPoultryRoutes._();
|
||||
|
||||
static const _base = '/chicken/cityPoultry';
|
||||
static const initCityPoultry = '$_base/';
|
||||
static const homeCityPoultry = '$_base/home';
|
||||
static const actionCityPoultry = '$_base/action';
|
||||
static const activeHatchingCityPoultry = '$_base/activeHatching';
|
||||
static const newInspectionCityPoultry = '$_base/newInspection';
|
||||
}
|
||||
|
||||
@@ -131,6 +131,7 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
|
||||
'killhouse',
|
||||
'provinceinspector',
|
||||
'cityjahad',
|
||||
'citypoultry',
|
||||
'jahad',
|
||||
'vetfarm',
|
||||
'provincesupervisor',
|
||||
|
||||
@@ -175,12 +175,12 @@ class ActiveHatchingPage extends GetView<ActiveHatchingLogic> {
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.user?.fullname ?? 'N/A',
|
||||
item.poultry?.user?.fullname ?? 'ندارد',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.user?.mobile ?? 'N/A',
|
||||
item.poultry?.user?.mobile ?? 'ندارد',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
@@ -195,12 +195,12 @@ class ActiveHatchingPage extends GetView<ActiveHatchingLogic> {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.unitName ?? 'N/Aaq',
|
||||
item.poultry?.unitName ?? 'ندارد',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.licenceNumber ?? 'N/A',
|
||||
item.licenceNumber ?? 'ندارد',
|
||||
textAlign: TextAlign.left,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
|
||||
@@ -23,7 +23,7 @@ class JahadHomeLogic extends GetxController {
|
||||
JahadActionItem(
|
||||
title: "بازرسی مزارع طیور",
|
||||
route: JahadRoutes.newInspectionJahad,
|
||||
icon: Assets.vec.activeFramSvg.path,
|
||||
icon: Assets.vec.inspectionPoultrySvg.path,
|
||||
),
|
||||
].obs;
|
||||
}
|
||||
|
||||
@@ -193,12 +193,12 @@ class ActiveHatchingPage extends GetView<ActiveHatchingLogic> {
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.user?.fullname ?? 'N/A',
|
||||
item.poultry?.user?.fullname ?? 'ندارد',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.user?.mobile ?? 'N/A',
|
||||
item.poultry?.user?.mobile ?? 'ندارد',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
@@ -213,12 +213,12 @@ class ActiveHatchingPage extends GetView<ActiveHatchingLogic> {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.unitName ?? 'N/Aaq',
|
||||
item.poultry?.unitName ?? 'ندارد',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.licenceNumber ?? 'N/A',
|
||||
item.licenceNumber ?? 'ندارد',
|
||||
textAlign: TextAlign.left,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
|
||||
@@ -40,7 +40,7 @@ class PoultryActionLogic extends GetxController {
|
||||
PoultryActionItem(
|
||||
title: "بازرسی مزارع طیور",
|
||||
route: PoultryScienceRoutes.newInspectionPoultryScience,
|
||||
icon: Assets.vec.activeFramSvg.path,
|
||||
icon: Assets.vec.inspectionPoultrySvg.path,
|
||||
),
|
||||
].obs;
|
||||
}
|
||||
|
||||
@@ -193,12 +193,12 @@ class ActiveHatchingPage extends GetView<ActiveHatchingLogic> {
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.user?.fullname ?? 'N/A',
|
||||
item.poultry?.user?.fullname ?? 'ندارد',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.user?.mobile ?? 'N/A',
|
||||
item.poultry?.user?.mobile ?? 'ندارد',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
@@ -213,12 +213,12 @@ class ActiveHatchingPage extends GetView<ActiveHatchingLogic> {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.unitName ?? 'N/Aaq',
|
||||
item.poultry?.unitName ?? 'ندارد',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.licenceNumber ?? 'N/A',
|
||||
item.licenceNumber ?? 'ندارد',
|
||||
textAlign: TextAlign.left,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
|
||||
@@ -24,7 +24,7 @@ class ProvinceInspectorHomeLogic extends GetxController {
|
||||
ProvinceInspectorActionItem(
|
||||
title: "بازرسی مزارع طیور",
|
||||
route: ProvinceInspectorRoutes.newInspectionProvinceInspector,
|
||||
icon: Assets.vec.activeFramSvg.path,
|
||||
icon: Assets.vec.inspectionPoultrySvg.path,
|
||||
),
|
||||
].obs;
|
||||
}
|
||||
|
||||
@@ -193,12 +193,12 @@ class ActiveHatchingPage extends GetView<ActiveHatchingLogic> {
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.user?.fullname ?? 'N/A',
|
||||
item.poultry?.user?.fullname ?? 'ندارد',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.user?.mobile ?? 'N/A',
|
||||
item.poultry?.user?.mobile ?? 'ندارد',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
@@ -213,12 +213,12 @@ class ActiveHatchingPage extends GetView<ActiveHatchingLogic> {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.unitName ?? 'N/Aaq',
|
||||
item.poultry?.unitName ?? 'ندارد',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.licenceNumber ?? 'N/A',
|
||||
item.licenceNumber ?? 'ندارد',
|
||||
textAlign: TextAlign.left,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
|
||||
@@ -24,7 +24,7 @@ class ProvinceOperatorHomeLogic extends GetxController {
|
||||
ProvinceOperatorHomeItem(
|
||||
title: "بازرسی مزارع طیور",
|
||||
route: ProvinceOperatorRoutes.newInspectionProvinceOperator,
|
||||
icon: Assets.vec.activeFramSvg.path,
|
||||
icon: Assets.vec.inspectionPoultrySvg.path,
|
||||
),
|
||||
].obs;
|
||||
}
|
||||
|
||||
@@ -193,12 +193,12 @@ class ActiveHatchingPage extends GetView<ActiveHatchingLogic> {
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.user?.fullname ?? 'N/A',
|
||||
item.poultry?.user?.fullname ?? 'ندارد',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.user?.mobile ?? 'N/A',
|
||||
item.poultry?.user?.mobile ?? 'ندارد',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
@@ -213,12 +213,12 @@ class ActiveHatchingPage extends GetView<ActiveHatchingLogic> {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.unitName ?? 'N/Aaq',
|
||||
item.poultry?.unitName ?? 'ندارد',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.licenceNumber ?? 'N/A',
|
||||
item.licenceNumber ?? 'ندارد',
|
||||
textAlign: TextAlign.left,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
|
||||
@@ -24,7 +24,7 @@ class ProvinceSupervisorHomeLogic extends GetxController {
|
||||
ProvinceSupervisorActionItem(
|
||||
title: "بازرسی مزارع طیور",
|
||||
route: ProvinceSupervisorRoutes.newInspectionProvinceSupervisor,
|
||||
icon: Assets.vec.activeFramSvg.path,
|
||||
icon: Assets.vec.inspectionPoultrySvg.path,
|
||||
),
|
||||
].obs;
|
||||
}
|
||||
|
||||
@@ -193,12 +193,12 @@ class ActiveHatchingPage extends GetView<ActiveHatchingLogic> {
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.user?.fullname ?? 'N/A',
|
||||
item.poultry?.user?.fullname ?? 'ندارد',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.user?.mobile ?? 'N/A',
|
||||
item.poultry?.user?.mobile ?? 'ندارد',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
@@ -213,12 +213,12 @@ class ActiveHatchingPage extends GetView<ActiveHatchingLogic> {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.unitName ?? 'N/Aaq',
|
||||
item.poultry?.unitName ?? 'ندارد',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.licenceNumber ?? 'N/A',
|
||||
item.licenceNumber ?? 'ندارد',
|
||||
textAlign: TextAlign.left,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
|
||||
@@ -20,7 +20,7 @@ class SuperAdminHomeLogic extends GetxController {
|
||||
SuperAdminHomeItem(
|
||||
title: "بازرسی مزارع طیور",
|
||||
route: SuperAdminRoutes.newInspectionSuperAdmin,
|
||||
icon: Assets.vec.activeFramSvg.path,
|
||||
icon: Assets.vec.inspectionPoultrySvg.path,
|
||||
),
|
||||
].obs;
|
||||
}
|
||||
|
||||
@@ -193,12 +193,12 @@ class ActiveHatchingPage extends GetView<ActiveHatchingLogic> {
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.user?.fullname ?? 'N/A',
|
||||
item.poultry?.user?.fullname ?? 'ندارد',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.user?.mobile ?? 'N/A',
|
||||
item.poultry?.user?.mobile ?? 'ندارد',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
@@ -213,12 +213,12 @@ class ActiveHatchingPage extends GetView<ActiveHatchingLogic> {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.unitName ?? 'N/Aaq',
|
||||
item.poultry?.unitName ?? 'ندارد',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.licenceNumber ?? 'N/A',
|
||||
item.licenceNumber ?? 'ندارد',
|
||||
textAlign: TextAlign.left,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
|
||||
@@ -19,7 +19,7 @@ class VetFarmHomeLogic extends GetxController {
|
||||
VetFarmHomeItem(
|
||||
title: "بازرسی مزارع طیور",
|
||||
route: VetFarmRoutes.newInspectionVetFarm,
|
||||
icon: Assets.vec.activeFramSvg.path,
|
||||
icon: Assets.vec.inspectionPoultrySvg.path,
|
||||
),
|
||||
].obs;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:rasadyar_chicken/features/city_poultry/presentation/routes/pages.dart';
|
||||
import 'package:rasadyar_chicken/features/common/common.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/action/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/action/view.dart';
|
||||
@@ -66,6 +67,10 @@ sealed class ChickenPages {
|
||||
...JahadPages.pages,
|
||||
//endregion
|
||||
|
||||
//region City Poultry Pages
|
||||
...CityPoultryPages.pages,
|
||||
//endregion
|
||||
|
||||
//region Poultry Farm Inspection
|
||||
GetPage(
|
||||
name: ChickenRoutes.poultryFarmInspectionHome,
|
||||
|
||||
@@ -41,6 +41,11 @@ const int cityJahadActionKey = 112;
|
||||
|
||||
//endregion
|
||||
|
||||
//region city poultry Keys
|
||||
const int cityPoultryActionKey = 117;
|
||||
|
||||
//endregion
|
||||
|
||||
//region vet farm Keys
|
||||
const int vetFarmActionKey = 113;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user