refactor: update data source and repository structure by removing unused files, enhancing model integration, and adjusting import paths for better organization

This commit is contained in:
2025-12-07 12:33:39 +03:30
parent c28a4a3177
commit 02686115cb
129 changed files with 5269 additions and 545 deletions

View File

@@ -0,0 +1,59 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/features/poultry_farm_inspection/home/logic.dart';
import 'package:rasadyar_core/core.dart';
Widget farmInfoWidget({
required PoultryFarmInspectionHomeLogic controller,
required String title,
required Widget child,
EdgeInsets? padding,
}) {
return Stack(
clipBehavior: Clip.none,
children: [
Positioned.fill(
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 0.50, color: AppColor.mediumGrey),
),
padding:
padding ?? EdgeInsets.symmetric(horizontal: 12.w, vertical: 11.h),
child: child,
),
),
Positioned(
top: -17,
right: 7,
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 5.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 0.50, color: AppColor.mediumGrey),
),
child: Text(
title,
style: AppFonts.yekan14.copyWith(color: AppColor.iconColor),
),
),
),
],
);
}
Widget cardInfo({required Widget child, EdgeInsets? padding}) {
return Container(
width: Get.width,
padding: padding ?? EdgeInsets.symmetric(horizontal: 12.w, vertical: 14.h),
decoration: BoxDecoration(
color: AppColor.bgLight,
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 1, color: AppColor.blackLight),
),
child: child,
);
}

View File

@@ -0,0 +1,224 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
import '../home/logic.dart';
import 'step1_page.dart';
import 'step2_page.dart';
import 'step3_page.dart';
import 'step4_page.dart';
import 'step5_page.dart';
Widget addOrEditBottomSheet(PoultryFarmInspectionHomeLogic controller) {
List<Widget> pages = [
step1Page(controller),
step2Page(controller),
step3Page(controller),
step4Page(controller),
step5Page(controller),
];
return BaseBottomSheet(
height: Get.height,
rootChild: Column(
children: [
ObxValue((data) {
return stepper(activeStep: data.value);
}, controller.activeStepperIndex),
Expanded(
child: PageView.builder(
physics: const NeverScrollableScrollPhysics(),
reverse: true,
controller: controller.pageController,
itemBuilder: (context, index) => pages[index],
),
),
ObxValue((data) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Row(
spacing: 16,
children: [
Expanded(
child: RElevated(
height: 40.h,
backgroundColor: AppColor.greenNormal,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.arrow_back_ios, color: Colors.white),
Text('ادامه'),
],
),
onPressed: () {
if (controller.activeStepperIndex.value <4) {
controller.activeStepperIndex.value++;
}
},
),
),
Expanded(
child: ROutlinedElevated(
borderColor: AppColor.error,
height: 40.h,
child: Text('برگشت'),
enabled: controller.activeStepperIndex.value > 0,
onPressed: () {
if (controller.activeStepperIndex.value > 0) {
controller.activeStepperIndex.value--;
}
},
),
),
],
),
);
}, controller.activeStepperIndex),
],
),
);
}
class stepper extends StatelessWidget {
const stepper({super.key, required this.activeStep});
final int activeStep;
@override
Widget build(BuildContext context) {
return Directionality(
textDirection: TextDirection.ltr,
child: SizedBox(
height: 24,
width: Get.width,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
alignment: Alignment.center,
decoration: BoxDecoration(
color: activeStep >= 0
? AppColor.greenNormalHover
: AppColor.whiteNormalActive,
shape: BoxShape.circle,
),
width: 24.w,
height: 24.h,
child: Text(
'1',
textAlign: TextAlign.center,
style: AppFonts.yekan16.copyWith(
color: activeStep >= 0 ? Colors.white : AppColor.iconColor,
),
),
),
Expanded(
child: Divider(
color: activeStep >= 1
? AppColor.greenNormalHover
: AppColor.whiteNormalActive,
thickness: 8,
),
),
Container(
alignment: Alignment.center,
decoration: BoxDecoration(
color: activeStep >= 1
? AppColor.greenNormalHover
: AppColor.whiteNormalActive,
shape: BoxShape.circle,
),
width: 24.w,
height: 24.h,
child: Text(
'2',
textAlign: TextAlign.center,
style: AppFonts.yekan16.copyWith(
color: activeStep >= 1 ? Colors.white : AppColor.iconColor,
),
),
),
Expanded(
child: Divider(
color: activeStep >= 2
? AppColor.greenNormalHover
: AppColor.whiteNormalActive,
thickness: 8,
),
),
Container(
alignment: Alignment.center,
decoration: BoxDecoration(
color: activeStep >= 2
? AppColor.greenNormalHover
: AppColor.whiteNormalActive,
shape: BoxShape.circle,
),
width: 24.w,
height: 24.h,
child: Text(
'3',
textAlign: TextAlign.center,
style: AppFonts.yekan16.copyWith(
color: activeStep >= 2 ? Colors.white : AppColor.iconColor,
),
),
),
Expanded(
child: Divider(
color: activeStep >= 3
? AppColor.greenNormalHover
: AppColor.whiteNormalActive,
thickness: 8,
),
),
Container(
alignment: Alignment.center,
decoration: BoxDecoration(
color: activeStep >= 3
? AppColor.greenNormalHover
: AppColor.whiteNormalActive,
shape: BoxShape.circle,
),
width: 24.w,
height: 24.h,
child: Text(
'4',
textAlign: TextAlign.center,
style: AppFonts.yekan16.copyWith(
color: activeStep >= 3 ? Colors.white : AppColor.iconColor,
),
),
),
Expanded(
child: Divider(
color: activeStep >= 4
? AppColor.greenNormalHover
: AppColor.whiteNormalActive,
thickness: 8,
),
),
Container(
alignment: Alignment.center,
decoration: BoxDecoration(
color: activeStep >= 4
? AppColor.greenNormalHover
: AppColor.whiteNormalActive,
shape: BoxShape.circle,
),
width: 24.w,
height: 24.h,
child: Text(
'5',
textAlign: TextAlign.center,
style: AppFonts.yekan16.copyWith(
color: activeStep >= 3 ? Colors.white : AppColor.iconColor,
),
),
),
],
),
),
);
}
}

View File

@@ -0,0 +1,166 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/features/poultry_farm_inspection/widgets/card_info.dart';
import 'package:rasadyar_core/core.dart';
import '../home/logic.dart';
Widget step1Page(PoultryFarmInspectionHomeLogic controller) {
return SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
SizedBox(height: 25.h),
Container(
height: 610.h,
clipBehavior: Clip.none,
width: Get.width,
child: farmInfoWidget(
controller: controller,
title: 'اطلاعات پایه واحد',
child: basicUnitInformation(controller),
),
),
SizedBox(height: 30.h),
Container(
height: 400.h,
clipBehavior: Clip.none,
width: Get.width,
child: farmInfoWidget(
controller: controller,
title: 'اطلاعات جوجه ریزی',
child: hatchingInformation(controller),
),
),
SizedBox(height: 16.h),
],
),
);
}
Column basicUnitInformation(PoultryFarmInspectionHomeLogic controller) {
return Column(
spacing: 10,
children: [
SizedBox(height: 1.h),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'نام واحد مرغداری',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'کد یکتا / شناسه واحد',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'نام مالک / بهره‌بردار',
filled: true,
filledColor: AppColor.bgLight,
),
ResourceOverlayDropdown(
items: Resource.success(['مالک', 'بهره‌بردار', 'مشاور', 'دیگر']),
itemBuilder: (item) => Text(item),
labelBuilder: (selected) => Text(selected ?? 'نوع مالکیت'),
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'کد ملی بهره‌بردار',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'شماره تماس بهره‌بردار',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'ظرفیت اسمی سالن‌ها',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'نوع سیستم پرورش',
filled: true,
filledColor: AppColor.bgLight,
),
RElevated(
isFullWidth: true,
height: 40.h,
backgroundColor: AppColor.greenNormal,
onPressed: () {},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 4,
children: [
Icon(Icons.my_location_rounded, color: Colors.white, size: 24),
Text('دریافت موقعیت جغرافیایی', style: AppFonts.yekan14.copyWith(color: Colors.white)),
],
),
),
],
);
}
Column hatchingInformation(PoultryFarmInspectionHomeLogic controller) {
return Column(
spacing: 10,
children: [
SizedBox(height: 1.h),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'تاریخ جوجه ریزی',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'تعداد جوجه‌ریزی اولیه',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'منبع تهیه جوجه',
filled: true,
filledColor: AppColor.bgLight,
),
ResourceOverlayDropdown(
items: Resource.success(['سرابی', 'پژدر', 'روتوایلر', 'دیگر']),
itemBuilder: (item) => Text(item),
labelBuilder: (selected) => Text(selected ?? 'نوع نژاد'),
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'گرید جوجه',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'میانگین وزن جوجه در ورود',
filled: true,
filledColor: AppColor.bgLight,
),
],
);
}

View File

@@ -0,0 +1,499 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/features/poultry_farm_inspection/widgets/card_info.dart';
import 'package:rasadyar_core/core.dart';
import '../home/logic.dart';
Widget step2Page(PoultryFarmInspectionHomeLogic controller) {
return SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
SizedBox(height: 35.h),
Container(
height: 760.h,
clipBehavior: Clip.none,
width: Get.width,
child: farmInfoWidget(
controller: controller,
title: 'وضعیت عمومی سالن',
child: generalConditionOfTheHall(controller),
),
),
SizedBox(height: 30.h),
Container(
height: 430.h,
clipBehavior: Clip.none,
width: Get.width,
child: farmInfoWidget(
controller: controller,
title: 'تلفات',
child: casualtiesInformation(controller),
),
),
SizedBox(height: 24.h),
Container(
height: 450.h,
clipBehavior: Clip.none,
width: Get.width,
child: farmInfoWidget(
controller: controller,
title: 'بیماری‌ها و وضعیت سلامت',
child: diseasesAndHealthInformation(controller),
),
),
],
),
);
}
Column generalConditionOfTheHall(PoultryFarmInspectionHomeLogic controller) {
return Column(
spacing: 10,
children: [
SizedBox(height: 12),
cardInfo(
padding: EdgeInsets.fromLTRB(0, 12, 12, 6),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
height: 80.h,
width: 80.w,
padding: EdgeInsets.all(22),
decoration: BoxDecoration(
color: Color(0xFFE9E9E9),
border: Border.all(width: 1, color: AppColor.blackLightHover),
borderRadius: BorderRadius.circular(8),
),
child: Assets.vec.galleryAddSvg.svg(width: 36, height: 36),
),
],
),
),
Text(
'تعداد موجود فعلی',
style: AppFonts.yekan14.copyWith(color: AppColor.textColorLight),
),
],
),
),
cardInfo(
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
Text(
'وضعیت بهداشتی سالن',
style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2),
),
ObxValue((data) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
formChips(
selectedIndex: data.value,
index: 0,
label: 'عالی',
onTap: (index) => controller.setSanitaryConditionOfTheHallIndex(index),
),
formChips(
selectedIndex: data.value,
index: 1,
label: 'خوب',
onTap: (index) => controller.setSanitaryConditionOfTheHallIndex(index),
),
formChips(
selectedIndex: data.value,
index: 2,
label: 'متوسط',
onTap: (index) => controller.setSanitaryConditionOfTheHallIndex(index),
),
formChips(
selectedIndex: data.value,
index: 3,
label: 'ضعیف',
onTap: (index) => controller.setSanitaryConditionOfTheHallIndex(index),
),
],
);
}, controller.sanitaryConditionOfTheHallIndex),
],
),
),
cardInfo(
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
Text('وضعیت تهویه', style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2)),
ObxValue((data) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 10,
children: [
formChips(
onTap: (index) => controller.setVentilationStatusIndex(index),
selectedIndex: data.value,
index: 0,
label: 'خشک',
),
formChips(
onTap: (index) => controller.setVentilationStatusIndex(index),
selectedIndex: data.value,
index: 1,
label: 'نیمه‌مرطوب',
),
formChips(
onTap: (index) => controller.setVentilationStatusIndex(index),
selectedIndex: data.value,
index: 2,
label: 'مرطوب',
),
],
);
}, controller.ventilationStatusIndex),
],
),
),
cardInfo(
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
Text('وضعیت بستر', style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2)),
ObxValue((data) {
return SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
spacing: 8,
children: [
formChips(
onTap: (index) => controller.setBeddingStatusIndex(index),
selectedIndex: data.value,
index: 0,
label: 'خشک',
),
formChips(
onTap: (index) => controller.setBeddingStatusIndex(index),
selectedIndex: data.value,
index: 1,
label: 'نیمه‌مرطوب',
),
formChips(
onTap: (index) => controller.setBeddingStatusIndex(index),
selectedIndex: data.value,
index: 2,
label: 'مرطوب',
),
formChips(
onTap: (index) => controller.setBeddingStatusIndex(index),
selectedIndex: data.value,
index: 2,
label: 'نیازمند اصلاح',
),
],
),
);
}, controller.beddingStatusIndex),
],
),
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'دمای سالن',
filled: true,
filledColor: AppColor.bgLight,
maxLines: 1,
minLines: 1,
keyboardType: TextInputType.number,
),
cardInfo(
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
Text(
'کیفیت آب مصرفی',
style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2),
),
ObxValue((data) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 10,
children: [
formChips(
onTap: (index) => controller.setWaterQualityIndex(index),
selectedIndex: data.value,
index: 0,
label: 'چاه',
),
formChips(
onTap: (index) => controller.setWaterQualityIndex(index),
selectedIndex: data.value,
index: 1,
label: 'شهری',
),
formChips(
onTap: (index) => controller.setWaterQualityIndex(index),
selectedIndex: data.value,
index: 2,
label: 'تصفیه‌شده',
),
],
);
}, controller.waterQualityIndex),
],
),
),
cardInfo(
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
Text(
'کیفیت آب مصرفی',
style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2),
),
ObxValue((data) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
formChips(
onTap: (index) => controller.setFuelTypeIndex(index),
selectedIndex: data.value,
index: 0,
label: 'گازوییل',
),
formChips(
onTap: (index) => controller.setFuelTypeIndex(index),
selectedIndex: data.value,
index: 1,
label: 'بنزین',
),
formChips(
onTap: (index) => controller.setFuelTypeIndex(index),
selectedIndex: data.value,
index: 2,
label: 'گاز',
),
formChips(
selectedIndex: data.value,
index: 3,
label: 'نفت',
onTap: (index) => controller.setFuelTypeIndex(index),
),
],
);
}, controller.fuelTypeIndex),
],
),
),
],
);
}
ChoiceChip formChips({
required int selectedIndex,
required int index,
required String label,
required Function(int) onTap,
}) {
return ChoiceChip(
selectedColor: AppColor.green1Normal,
labelStyle: index == selectedIndex
? AppFonts.yekan14Bold.copyWith(color: Colors.white)
: AppFonts.yekan14.copyWith(color: AppColor.textColor),
surfaceTintColor: Colors.white,
checkmarkColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
side: index == selectedIndex
? BorderSide.none
: BorderSide(width: 1, color: AppColor.blackLightHover),
),
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 6),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
label: Text(label),
selected: index == selectedIndex,
onSelected: (value) => onTap(index),
);
}
Column casualtiesInformation(PoultryFarmInspectionHomeLogic controller) {
return Column(
spacing: 10,
children: [
SizedBox(height: 1.h),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'تعداد تلفات عادی دوره',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'تلفات غیرعادی',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'منبع تهیه جوجه',
filled: true,
filledColor: AppColor.bgLight,
),
ResourceOverlayDropdown(
items: Resource.success(['بیماری', 'قطعی برق', 'استرس گرمایی', 'مشکلات دانه']),
itemBuilder: (item) => Text(item),
labelBuilder: (selected) => Text(selected ?? 'علت احتمالی تلفات غیرعادی'),
),
ResourceOverlayDropdown(
items: Resource.success(['انجام نشد', 'انجام شد']),
itemBuilder: (item) => Text(item),
labelBuilder: (selected) => Text(selected ?? 'نمونه‌برداری انجام‌شده'),
),
cardInfo(
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
Text('نوع نمونه', style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2)),
ObxValue((data) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 10,
children: [
formChips(
onTap: (index) => controller.setSampleTypeIndex(index),
selectedIndex: data.value,
index: 0,
label: 'رنده',
),
formChips(
onTap: (index) => controller.setSampleTypeIndex(index),
selectedIndex: data.value,
index: 1,
label: 'لاشه',
),
formChips(
onTap: (index) => controller.setSampleTypeIndex(index),
selectedIndex: data.value,
index: 2,
label: 'ترکیبی',
),
],
);
}, controller.sampleTypeIndex),
],
),
),
],
);
}
Column diseasesAndHealthInformation(PoultryFarmInspectionHomeLogic controller) {
return Column(
spacing: 10,
children: [
SizedBox(height: 1.h),
ResourceOverlayDropdown(
items: Resource.success(['بیماری', 'قطعی برق', 'استرس گرمایی', 'مشکلات دانه']),
itemBuilder: (item) => Text(item),
labelBuilder: (selected) => Text(selected ?? 'وجود علائم بیماری در گله'),
),
ResourceOverlayDropdown(
items: Resource.success(['انجام نشد', 'انجام شد']),
itemBuilder: (item) => Text(item),
labelBuilder: (selected) => Text(selected ?? 'نوع بیماری تشخیص داده‌شده / مشکوک'),
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'تاریخ واکسیناسیون‌های انجام‌شده',
filled: true,
filledColor: AppColor.bgLight,
),
ResourceOverlayDropdown(
items: Resource.success([
'واکسن 1',
'واکسن 2',
'واکسن 3',
'واکسن 4',
'واکسن 5',
'واکسن 6',
'واکسن 7',
'واکسن 8',
'واکسن 9',
'واکسن 10',
]),
itemBuilder: (item) => Text(item),
labelBuilder: (selected) => Text(selected ?? 'نوع واکسن'),
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'شرکت تولیدکننده',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'نام مسئول فنی بهداشتی',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'نام مسئول فنی نظام مهندسی',
filled: true,
filledColor: AppColor.bgLight,
),
],
);
}

View File

@@ -0,0 +1,719 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/features/poultry_farm_inspection/widgets/card_info.dart';
import 'package:rasadyar_core/core.dart';
import '../home/logic.dart';
Widget step3Page(PoultryFarmInspectionHomeLogic controller) {
return SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
SizedBox(height: 35.h),
Container(
height: 410.h,
clipBehavior: Clip.none,
width: Get.width,
child: farmInfoWidget(
controller: controller,
title: 'نهاده و خوراک',
child: agriculturalInput(controller),
),
),
SizedBox(height: 30.h),
Container(
height: 650.h,
clipBehavior: Clip.none,
width: Get.width,
child: farmInfoWidget(
controller: controller,
title: 'زیرساخت و انرژی',
child: infrastructureAndEnergy(controller),
),
),
SizedBox(height: 24.h),
Container(
height: 405.h,
clipBehavior: Clip.none,
width: Get.width,
child: farmInfoWidget(
controller: controller,
title: 'نیروی انسانی',
child: humanResources(controller),
),
),
SizedBox(height: 24.h),
Container(
height: 440.h,
clipBehavior: Clip.none,
width: Get.width,
child: farmInfoWidget(
controller: controller,
title: 'تسهیلات و حمایت‌ها',
child: facilitiesAndSupport(controller),
),
),
],
),
);
}
Column agriculturalInput2(PoultryFarmInspectionHomeLogic controller) {
return Column(
spacing: 10,
children: [
cardInfo(
padding: EdgeInsets.fromLTRB(0, 12, 12, 6),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
height: 80.h,
width: 80.w,
padding: EdgeInsets.all(22),
decoration: BoxDecoration(
color: Color(0xFFE9E9E9),
border: Border.all(width: 1, color: AppColor.blackLightHover),
borderRadius: BorderRadius.circular(8),
),
child: Assets.vec.galleryAddSvg.svg(width: 36, height: 36),
),
],
),
),
Text(
'تعداد موجود فعلی',
style: AppFonts.yekan14.copyWith(color: AppColor.textColorLight),
),
],
),
),
cardInfo(
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
Text(
'وضعیت بهداشتی سالن',
style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2),
),
ObxValue((data) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
formChips(
selectedIndex: data.value,
index: 0,
label: 'عالی',
onTap: (index) => controller.setSanitaryConditionOfTheHallIndex(index),
),
formChips(
selectedIndex: data.value,
index: 1,
label: 'خوب',
onTap: (index) => controller.setSanitaryConditionOfTheHallIndex(index),
),
formChips(
selectedIndex: data.value,
index: 2,
label: 'متوسط',
onTap: (index) => controller.setSanitaryConditionOfTheHallIndex(index),
),
formChips(
selectedIndex: data.value,
index: 3,
label: 'ضعیف',
onTap: (index) => controller.setSanitaryConditionOfTheHallIndex(index),
),
],
);
}, controller.sanitaryConditionOfTheHallIndex),
],
),
),
cardInfo(
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
Text('وضعیت تهویه', style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2)),
ObxValue((data) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 10,
children: [
formChips(
onTap: (index) => controller.setVentilationStatusIndex(index),
selectedIndex: data.value,
index: 0,
label: 'خشک',
),
formChips(
onTap: (index) => controller.setVentilationStatusIndex(index),
selectedIndex: data.value,
index: 1,
label: 'نیمه‌مرطوب',
),
formChips(
onTap: (index) => controller.setVentilationStatusIndex(index),
selectedIndex: data.value,
index: 2,
label: 'مرطوب',
),
],
);
}, controller.ventilationStatusIndex),
],
),
),
cardInfo(
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
Text('وضعیت بستر', style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2)),
ObxValue((data) {
return SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
spacing: 8,
children: [
formChips(
onTap: (index) => controller.setBeddingStatusIndex(index),
selectedIndex: data.value,
index: 0,
label: 'خشک',
),
formChips(
onTap: (index) => controller.setBeddingStatusIndex(index),
selectedIndex: data.value,
index: 1,
label: 'نیمه‌مرطوب',
),
formChips(
onTap: (index) => controller.setBeddingStatusIndex(index),
selectedIndex: data.value,
index: 2,
label: 'مرطوب',
),
formChips(
onTap: (index) => controller.setBeddingStatusIndex(index),
selectedIndex: data.value,
index: 2,
label: 'نیازمند اصلاح',
),
],
),
);
}, controller.beddingStatusIndex),
],
),
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'دمای سالن',
filled: true,
filledColor: AppColor.bgLight,
maxLines: 1,
minLines: 1,
keyboardType: TextInputType.number,
),
cardInfo(
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
Text(
'کیفیت آب مصرفی',
style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2),
),
ObxValue((data) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 10,
children: [
formChips(
onTap: (index) => controller.setWaterQualityIndex(index),
selectedIndex: data.value,
index: 0,
label: 'چاه',
),
formChips(
onTap: (index) => controller.setWaterQualityIndex(index),
selectedIndex: data.value,
index: 1,
label: 'شهری',
),
formChips(
onTap: (index) => controller.setWaterQualityIndex(index),
selectedIndex: data.value,
index: 2,
label: 'تصفیه‌شده',
),
],
);
}, controller.waterQualityIndex),
],
),
),
cardInfo(
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
Text(
'کیفیت آب مصرفی',
style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2),
),
ObxValue((data) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
formChips(
onTap: (index) => controller.setFuelTypeIndex(index),
selectedIndex: data.value,
index: 0,
label: 'گازوییل',
),
formChips(
onTap: (index) => controller.setFuelTypeIndex(index),
selectedIndex: data.value,
index: 1,
label: 'بنزین',
),
formChips(
onTap: (index) => controller.setFuelTypeIndex(index),
selectedIndex: data.value,
index: 2,
label: 'گاز',
),
formChips(
selectedIndex: data.value,
index: 3,
label: 'نفت',
onTap: (index) => controller.setFuelTypeIndex(index),
),
],
);
}, controller.fuelTypeIndex),
],
),
),
],
);
}
ChoiceChip formChips({
required int selectedIndex,
required int index,
required String label,
required Function(int) onTap,
}) {
return ChoiceChip(
selectedColor: AppColor.green1Normal,
labelStyle: index == selectedIndex
? AppFonts.yekan14Bold.copyWith(color: Colors.white)
: AppFonts.yekan14.copyWith(color: AppColor.textColor),
surfaceTintColor: Colors.white,
checkmarkColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
side: index == selectedIndex
? BorderSide.none
: BorderSide(width: 1, color: AppColor.blackLightHover),
),
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 6),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
label: Text(label),
selected: index == selectedIndex,
onSelected: (value) => onTap(index),
);
}
Column infrastructureAndEnergy(PoultryFarmInspectionHomeLogic controller) {
return Column(
spacing: 10,
children: [
SizedBox(height: 1.h),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'نوع ژنراتور',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'ظرفیت (KVA)',
filled: true,
filledColor: AppColor.bgLight,
),
cardInfo(
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
Text(
'وضعیت عملکرد ژنراتور',
style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2),
),
ObxValue((data) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 10,
children: [
formChips(
onTap: (index) => controller.setGeneratorOperatingStatusIndex(index),
selectedIndex: data.value,
index: 0,
label: 'سالم',
),
formChips(
onTap: (index) => controller.setGeneratorOperatingStatusIndex(index),
selectedIndex: data.value,
index: 1,
label: 'نیمه‌سالم',
),
formChips(
onTap: (index) => controller.setGeneratorOperatingStatusIndex(index),
selectedIndex: data.value,
index: 2,
label: 'معیوب',
),
],
);
}, controller.generatorOperatingStatusIndex),
],
),
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'میزان موجودی سوخت اضطراری (لیتر)',
filled: true,
filledColor: AppColor.bgLight,
),
ResourceOverlayDropdown(
items: Resource.success(['بیماری', 'قطعی برق', 'استرس گرمایی', 'مشکلات دانه']),
itemBuilder: (item) => Text(item),
labelBuilder: (selected) => Text(selected ?? 'علت احتمالی تلفات غیرعادی'),
),
ResourceOverlayDropdown(
items: Resource.success(['ندارد', 'دارد']),
itemBuilder: (item) => Text(item),
labelBuilder: (selected) => Text(selected ?? 'سابقه قطعی برق دوره جاری'),
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'تعداد تلفات',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'مدت قطعی',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'توضیحات تکمیلی',
filled: true,
maxLines: 3,
minLines: 3,
filledColor: AppColor.bgLight,
),
],
);
}
Column agriculturalInput(PoultryFarmInspectionHomeLogic controller) {
return Column(
spacing: 10,
children: [
SizedBox(height: 1.h),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'میزان نهاده مصرفی تا روز بازدید (کیلوگرم)',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'میزان نهاده موجود در انبار',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'میزان نهاده خریداری‌شده و حمل‌نشده از بازارگاه',
filled: true,
filledColor: AppColor.bgLight,
),
cardInfo(
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
Text('کیفیت دانه', style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2)),
ObxValue((data) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 10,
children: [
formChips(
onTap: (index) => controller.setSampleTypeIndex(index),
selectedIndex: data.value,
index: 0,
label: 'خوب',
),
formChips(
onTap: (index) => controller.setSampleTypeIndex(index),
selectedIndex: data.value,
index: 1,
label: 'متوسط',
),
formChips(
onTap: (index) => controller.setGrainQualityInputIndex(index),
selectedIndex: data.value,
index: 2,
label: 'ضعیف',
),
],
);
}, controller.grainQualityInputIndex),
],
),
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'فرمول دانه (در صورت ارائه)',
filled: true,
minLines: 3,
maxLines: 3,
filledColor: AppColor.bgLight,
),
],
);
}
Column humanResources(PoultryFarmInspectionHomeLogic controller) {
return Column(
spacing: 10,
children: [
SizedBox(height: 1.h),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'تعداد افراد شاغل',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'تعداد افراد بومی',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'تعداد افراد غیر بومی',
filled: true,
maxLines: 3,
minLines: 3,
filledColor: AppColor.bgLight,
),
cardInfo(
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
Text(
'وضعیت قرارداد کارگران',
style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2),
),
ObxValue((data) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 10,
children: [
formChips(
onTap: (index) => controller.setWorkerContractStatusIndex(index),
selectedIndex: data.value,
index: 0,
label: 'دائم',
),
formChips(
onTap: (index) => controller.setWorkerContractStatusIndex(index),
selectedIndex: data.value,
index: 1,
label: 'موقت',
),
formChips(
onTap: (index) => controller.setWorkerContractStatusIndex(index),
selectedIndex: data.value,
index: 2,
label: 'روزمزدی',
),
],
);
}, controller.workerContractStatusIndex),
],
),
),
ResourceOverlayDropdown(
items: Resource.success(['آموزش‌ ندیده است', 'آموزش‌ دیده است']),
itemBuilder: (item) => Text(item),
labelBuilder: (selected) => Text(selected ?? 'آموزش‌دیده در حوزه بهداشت و امنیت زیستی'),
),
],
);
}
Column facilitiesAndSupport(PoultryFarmInspectionHomeLogic controller) {
return Column(
spacing: 10,
children: [
SizedBox(height: 1.h),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'تسهیلات دریافتی فعال',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'نوع تسهیلات',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'مبلغ',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'سال دریافت',
filled: true,
filledColor: AppColor.bgLight,
),
ResourceOverlayDropdown(
items: Resource.success(['دریافت نشده', 'دریافت شده']),
itemBuilder: (item) => Text(item),
labelBuilder: (selected) => Text(selected ?? 'وضعیت بازپرداخت'),
),
cardInfo(
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
Text(
'درخواست جدید بهره‌بردار',
style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2),
),
ObxValue((data) {
return SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 10,
children: [
formChips(
onTap: (index) => controller.setNewBeneficiaryRequestIndex(index),
selectedIndex: data.value,
index: 0,
label: 'نهاده',
),
formChips(
onTap: (index) => controller.setNewBeneficiaryRequestIndex(index),
selectedIndex: data.value,
index: 1,
label: 'تسهیلات',
),
formChips(
onTap: (index) => controller.setNewBeneficiaryRequestIndex(index),
selectedIndex: data.value,
index: 2,
label: 'واکسن',
),
formChips(
onTap: (index) => controller.setNewBeneficiaryRequestIndex(index),
selectedIndex: data.value,
index: 3,
label: 'تجهیزات',
),
],
),
);
}, controller.newBeneficiaryRequestIndex),
],
),
),
],
);
}

View File

@@ -0,0 +1,487 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/features/poultry_farm_inspection/widgets/card_info.dart';
import 'package:rasadyar_core/core.dart';
import '../home/logic.dart';
Widget step4Page(PoultryFarmInspectionHomeLogic controller) {
return SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
SizedBox(height: 35.h),
Container(
height: 455.h,
clipBehavior: Clip.none,
width: Get.width,
child: farmInfoWidget(
controller: controller,
title: 'مستندات',
child: documents(controller),
),
),
SizedBox(height: 30.h),
Container(
height: 220.h,
clipBehavior: Clip.none,
width: Get.width,
child: farmInfoWidget(
controller: controller,
title: 'جمع‌بندی بازرس',
child: inspectorConclusion(controller),
),
),
SizedBox(height: 24.h),
],
),
);
}
Column documents(PoultryFarmInspectionHomeLogic controller) {
return Column(
spacing: 10,
children: [
cardInfo(
padding: EdgeInsets.fromLTRB(0, 12, 12, 6),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
SizedBox(height: 10.h),
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
height: 80.h,
width: 80.w,
padding: EdgeInsets.all(22),
decoration: BoxDecoration(
color: Color(0xFFE9E9E9),
border: Border.all(width: 1, color: AppColor.blackLightHover),
borderRadius: BorderRadius.circular(8),
),
child: Assets.vec.galleryAddSvg.svg(width: 36, height: 36),
),
],
),
),
Text(
'ثبت عکس سالن (حداقل ۳ زاویه) *',
style: AppFonts.yekan14.copyWith(color: AppColor.textColorLight),
),
],
),
),
cardInfo(
padding: EdgeInsets.fromLTRB(0, 12, 12, 6),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
height: 80.h,
width: 80.w,
padding: EdgeInsets.all(22),
decoration: BoxDecoration(
color: Color(0xFFE9E9E9),
border: Border.all(width: 1, color: AppColor.blackLightHover),
borderRadius: BorderRadius.circular(8),
),
child: Assets.vec.galleryAddSvg.svg(width: 36, height: 36),
),
],
),
),
Text(
'ثبت عکس انبار نهاده‌ها',
style: AppFonts.yekan14.copyWith(color: AppColor.textColorLight),
),
],
),
),
cardInfo(
padding: EdgeInsets.fromLTRB(0, 12, 12, 6),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
height: 80.h,
width: 80.w,
padding: EdgeInsets.all(22),
decoration: BoxDecoration(
color: Color(0xFFE9E9E9),
border: Border.all(width: 1, color: AppColor.blackLightHover),
borderRadius: BorderRadius.circular(8),
),
child: Assets.vec.galleryAddSvg.svg(width: 36, height: 36),
),
],
),
),
Text('ثبت عکس تلفات', style: AppFonts.yekan14.copyWith(color: AppColor.textColorLight)),
],
),
),
],
);
}
ChoiceChip formChips({
required int selectedIndex,
required int index,
required String label,
required Function(int) onTap,
}) {
return ChoiceChip(
selectedColor: AppColor.green1Normal,
labelStyle: index == selectedIndex
? AppFonts.yekan14Bold.copyWith(color: Colors.white)
: AppFonts.yekan14.copyWith(color: AppColor.textColor),
surfaceTintColor: Colors.white,
checkmarkColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
side: index == selectedIndex
? BorderSide.none
: BorderSide(width: 1, color: AppColor.blackLightHover),
),
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 6),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
label: Text(label),
selected: index == selectedIndex,
onSelected: (value) => onTap(index),
);
}
Column inspectorConclusion(PoultryFarmInspectionHomeLogic controller) {
return Column(
spacing: 10,
children: [
SizedBox(height: 1.h),
cardInfo(
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
Text(
'وضعیت کلی واحد',
style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2),
),
ObxValue((data) {
return SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 10,
children: [
formChips(
onTap: (index) => controller.setInspectorConclusionIndex(index),
selectedIndex: data.value,
index: 0,
label: 'تایید شده',
),
formChips(
onTap: (index) => controller.setInspectorConclusionIndex(index),
selectedIndex: data.value,
index: 1,
label: 'نیازمند اصلاح',
),
formChips(
onTap: (index) => controller.setInspectorConclusionIndex(index),
selectedIndex: data.value,
index: 2,
label: 'پرریسک',
),
],
),
);
}, controller.inspectorConclusionIndex),
],
),
),
RTextField(
controller: controller.inspectorConclusionDescriptionController,
hintText: 'توصیه‌ها / اخطارها / اقدامات اصلاحی ...',
hintStyle: AppFonts.yekan14.copyWith(color: AppColor.textColorLight),
maxLines: 3,
minLines: 3,
filled: true,
filledColor: AppColor.bgLight,
),
],
);
}
Column agriculturalInput(PoultryFarmInspectionHomeLogic controller) {
return Column(
spacing: 10,
children: [
SizedBox(height: 1.h),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'میزان نهاده مصرفی تا روز بازدید (کیلوگرم)',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'میزان نهاده موجود در انبار',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'میزان نهاده خریداری‌شده و حمل‌نشده از بازارگاه',
filled: true,
filledColor: AppColor.bgLight,
),
cardInfo(
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
Text('کیفیت دانه', style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2)),
ObxValue((data) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 10,
children: [
formChips(
onTap: (index) => controller.setSampleTypeIndex(index),
selectedIndex: data.value,
index: 0,
label: 'خوب',
),
formChips(
onTap: (index) => controller.setSampleTypeIndex(index),
selectedIndex: data.value,
index: 1,
label: 'متوسط',
),
formChips(
onTap: (index) => controller.setGrainQualityInputIndex(index),
selectedIndex: data.value,
index: 2,
label: 'ضعیف',
),
],
);
}, controller.grainQualityInputIndex),
],
),
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'فرمول دانه (در صورت ارائه)',
filled: true,
minLines: 3,
maxLines: 3,
filledColor: AppColor.bgLight,
),
],
);
}
Column humanResources(PoultryFarmInspectionHomeLogic controller) {
return Column(
spacing: 10,
children: [
SizedBox(height: 1.h),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'تعداد افراد شاغل',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'تعداد افراد بومی',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'تعداد افراد غیر بومی',
filled: true,
maxLines: 3,
minLines: 3,
filledColor: AppColor.bgLight,
),
cardInfo(
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
Text(
'وضعیت قرارداد کارگران',
style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2),
),
ObxValue((data) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 10,
children: [
formChips(
onTap: (index) => controller.setWorkerContractStatusIndex(index),
selectedIndex: data.value,
index: 0,
label: 'دائم',
),
formChips(
onTap: (index) => controller.setWorkerContractStatusIndex(index),
selectedIndex: data.value,
index: 1,
label: 'موقت',
),
formChips(
onTap: (index) => controller.setWorkerContractStatusIndex(index),
selectedIndex: data.value,
index: 2,
label: 'روزمزدی',
),
],
);
}, controller.workerContractStatusIndex),
],
),
),
ResourceOverlayDropdown(
items: Resource.success(['آموزش‌ ندیده است', 'آموزش‌ دیده است']),
itemBuilder: (item) => Text(item),
labelBuilder: (selected) => Text(selected ?? 'آموزش‌دیده در حوزه بهداشت و امنیت زیستی'),
),
],
);
}
Column facilitiesAndSupport(PoultryFarmInspectionHomeLogic controller) {
return Column(
spacing: 10,
children: [
SizedBox(height: 1.h),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'تسهیلات دریافتی فعال',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'نوع تسهیلات',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'مبلغ',
filled: true,
filledColor: AppColor.bgLight,
),
RTextField(
controller: controller.nameOfThePoultryFarmUnit,
label: 'سال دریافت',
filled: true,
filledColor: AppColor.bgLight,
),
ResourceOverlayDropdown(
items: Resource.success(['دریافت نشده', 'دریافت شده']),
itemBuilder: (item) => Text(item),
labelBuilder: (selected) => Text(selected ?? 'وضعیت بازپرداخت'),
),
cardInfo(
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 9,
children: [
Text(
'درخواست جدید بهره‌بردار',
style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2),
),
ObxValue((data) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 10,
children: [
formChips(
onTap: (index) => controller.setNewBeneficiaryRequestIndex(index),
selectedIndex: data.value,
index: 0,
label: 'نهاده',
),
formChips(
onTap: (index) => controller.setNewBeneficiaryRequestIndex(index),
selectedIndex: data.value,
index: 1,
label: 'تسهیلات',
),
formChips(
onTap: (index) => controller.setNewBeneficiaryRequestIndex(index),
selectedIndex: data.value,
index: 2,
label: 'واکسن',
),
formChips(
onTap: (index) => controller.setNewBeneficiaryRequestIndex(index),
selectedIndex: data.value,
index: 3,
label: 'تجهیزات',
),
],
);
}, controller.newBeneficiaryRequestIndex),
],
),
),
],
);
}

View File

@@ -0,0 +1,598 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
import '../home/logic.dart';
Widget step5Page(PoultryFarmInspectionHomeLogic controller) {
return SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: detailsWidget(controller),
);
}
Widget detailsWidget(PoultryFarmInspectionHomeLogic controller) {
return Column(
children: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
children: [
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 4,
vertical: 10,
),
child: Text(
'جزییات',
style: AppFonts.yekan18Bold.copyWith(
color: AppColor.iconColor,
),
),
),
],
),
Divider(color: AppColor.blackLightHover, height: 1, thickness: 1),
ObxValue((data) {
return tabBarWidget(
['اطلاعات', 'پاییش سلامت', 'زیرساخت', 'مستندات'],
controller.selectedTabIndex.value,
(index) => controller.changeTab(index),
);
}, controller.selectedTabIndex),
ObxValue((data) {
switch (data.value) {
case 0:
return infoTable();
case 1:
return healthTable();
case 2:
return infrastructureTable();
case 3:
return documentsTable();
default:
return infoTable();
}
}, controller.selectedTabIndex),
],
),
// Expanded در سطح بالاتر
],
);
}
Column infoTable() {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(height: 10),
Row(
children: [
Text(
'مشخصات کلی',
style: AppFonts.yekan16Bold.copyWith(color: AppColor.iconColor),
),
],
),
SizedBox(height: 10),
Container(
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: Column(
children: [
rTableRow(title: 'نام واحد مرغداری', value: 'لذیذ'),
rTableRow(title: 'کد یکتا / شناسه واحد', value: '2541415'),
rTableRow(title: 'نام مالک / بهره‌بردار', value: 'مرغداری احمدی'),
rTableRow(title: 'موجودی سوخت اضطراری', value: '200 لیتر'),
rTableRow(title: 'شهر/تعاونی', value: 'خرم آباد/تعاونی خرم آباد'),
rTableRow(title: 'شماره تلفن واحد', value: '021-12345678'),
rTableRow(title: 'دامپزشک فارم', value: 'dd dd (05218569685)'),
rTableRow(title: 'سالن', value: '2'),
rTableRow(
title: 'تاریخ ثبت جوجه ریزی',
value: '1402/09/19 (10:12)',
),
rTableRow(title: 'شهر/تعاونی', value: 'خرم آباد/تعاونی خرم آباد'),
rTableRow(title: 'شماره تلفن واحد', value: '021-12345678'),
rTableRow(title: 'دامپزشک فارم', value: 'dd dd (05218569685)'),
rTableRow(title: 'سالن', value: '2'),
rTableRow(
title: 'تاریخ ثبت جوجه ریزی',
value: '1402/09/19 (10:12)',
),
],
),
),
],
);
}
Row rTableRow({String? title, String? value}) {
return Row(
children: [
Expanded(
flex: 1,
child: Container(
padding: EdgeInsets.symmetric(horizontal: 9, vertical: 11),
alignment: Alignment.centerRight,
decoration: BoxDecoration(
color: AppColor.bgLight2,
border: Border(
bottom: BorderSide(color: AppColor.blackLightHover, width: 1),
),
),
child: Text(
title ?? '',
style: AppFonts.yekan14Bold.copyWith(color: AppColor.iconColor),
),
),
),
Expanded(
flex: 1,
child: Container(
padding: EdgeInsets.symmetric(horizontal: 9, vertical: 11),
alignment: Alignment.centerRight,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(color: AppColor.blackLightHover, width: 1),
),
),
child: Text(
value ?? '',
style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor),
),
),
),
],
);
}
Widget tabBarWidget(
List<String> tabs,
int selectedIndex,
Function(int) onTabSelected,
) {
return SizedBox(
height: 38.h,
width: Get.width,
child: Stack(
fit: StackFit.expand,
children: [
Positioned(
right: 0,
top: 0,
bottom: 0,
child: Row(
children: [
...tabs.map(
(tab) => GestureDetector(
onTap: () => onTabSelected(tabs.indexOf(tab)),
behavior: HitTestBehavior.opaque,
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 11),
decoration: BoxDecoration(
border: tab == tabs[selectedIndex]
? Border(
bottom: BorderSide(
color: AppColor.blueNormalOld,
width: 3,
),
)
: null,
),
child: Text(
tab,
style: AppFonts.yekan12Bold.copyWith(
color: tab == tabs[selectedIndex]
? AppColor.blueNormalOld
: AppColor.mediumGrey,
),
),
),
),
),
],
),
),
Positioned(
bottom: 0,
left: 0,
right: 0,
child: Divider(
color: AppColor.blackLightHover,
height: 1,
thickness: 1,
),
),
],
),
);
}
Widget healthTable() {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(height: 10),
Row(
children: [
Text(
'پاییش سلامت',
style: AppFonts.yekan16Bold.copyWith(color: AppColor.iconColor),
),
],
),
SizedBox(height: 10),
Container(
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: Column(
children: [
rTableRow(title: 'نام واحد مرغداری', value: 'لذیذ'),
rTableRow(title: 'کد یکتا / شناسه واحد', value: '2541415'),
rTableRow(title: 'نام مالک / بهره‌بردار', value: 'مرغداری احمدی'),
rTableRow(title: 'موجودی سوخت اضطراری', value: '200 لیتر'),
rTableRow(title: 'شهر/تعاونی', value: 'خرم آباد/تعاونی خرم آباد'),
rTableRow(title: 'شماره تلفن واحد', value: '021-12345678'),
rTableRow(title: 'دامپزشک فارم', value: 'dd dd (05218569685)'),
rTableRow(title: 'سالن', value: '2'),
rTableRow(
title: 'تاریخ ثبت جوجه ریزی',
value: '1402/09/19 (10:12)',
),
rTableRow(title: 'شهر/تعاونی', value: 'خرم آباد/تعاونی خرم آباد'),
rTableRow(title: 'شماره تلفن واحد', value: '021-12345678'),
rTableRow(title: 'دامپزشک فارم', value: 'dd dd (05218569685)'),
rTableRow(title: 'سالن', value: '2'),
rTableRow(
title: 'تاریخ ثبت جوجه ریزی',
value: '1402/09/19 (10:12)',
),
],
),
),
],
);
}
Widget infrastructureTable() {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(height: 10),
Row(
children: [
Text(
'زیرساخت',
style: AppFonts.yekan16Bold.copyWith(color: AppColor.iconColor),
),
],
),
SizedBox(height: 10),
Container(
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: Column(
children: [
rTableRow(title: 'نام واحد مرغداری', value: 'لذیذ'),
rTableRow(title: 'کد یکتا / شناسه واحد', value: '2541415'),
rTableRow(title: 'نام مالک / بهره‌بردار', value: 'مرغداری احمدی'),
rTableRow(title: 'موجودی سوخت اضطراری', value: '200 لیتر'),
rTableRow(title: 'شهر/تعاونی', value: 'خرم آباد/تعاونی خرم آباد'),
rTableRow(title: 'شماره تلفن واحد', value: '021-12345678'),
rTableRow(title: 'دامپزشک فارم', value: 'dd dd (05218569685)'),
rTableRow(title: 'سالن', value: '2'),
rTableRow(
title: 'تاریخ ثبت جوجه ریزی',
value: '1402/09/19 (10:12)',
),
rTableRow(title: 'شهر/تعاونی', value: 'خرم آباد/تعاونی خرم آباد'),
rTableRow(title: 'شماره تلفن واحد', value: '021-12345678'),
rTableRow(title: 'دامپزشک فارم', value: 'dd dd (05218569685)'),
rTableRow(title: 'سالن', value: '2'),
rTableRow(
title: 'تاریخ ثبت جوجه ریزی',
value: '1402/09/19 (10:12)',
),
],
),
),
],
);
}
Widget documentsTable() {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(height: 10),
Row(
children: [
Text(
'مستندات',
style: AppFonts.yekan16Bold.copyWith(color: AppColor.iconColor),
),
],
),
SizedBox(height: 16),
Container(
height: 135.h,
width: Get.width,
decoration: BoxDecoration(
color: AppColor.bgLight,
borderRadius: BorderRadius.circular(8),
),
child: Column(
spacing: 10,
children: [
SizedBox(
height: 100.h,
width: Get.width,
child: ListView.separated(
itemCount: 10,
padding: EdgeInsets.symmetric(horizontal: 12),
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
return Container(
width: 80.w,
height: 80.h,
decoration: BoxDecoration(
color: Color(0x33000000),
image: DecorationImage(
fit: BoxFit.cover,
image: NetworkImage(
"https://picsum.photos/150/150?random=$index",
),
),
borderRadius: BorderRadius.circular(8),
),
child: Stack(
fit: StackFit.expand,
children: [
Positioned(
top: 6,
left: 6,
child: Container(
width: 24.w,
height: 24.h,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Colors.white.withValues(alpha: 0.80),
borderRadius: BorderRadius.circular(4),
),
child: Assets.vec.trashSvg.svg(
width: 16.w,
height: 16.h,
colorFilter: ColorFilter.mode(
AppColor.redNormal,
BlendMode.srcIn,
),
),
),
),
],
),
);
},
separatorBuilder: (context, index) => SizedBox(width: 10),
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 18),
child: Row(
children: [
Text(
'200 فارم در این سالن تخمین زده شده است.',
textAlign: TextAlign.right,
style: AppFonts.yekan14Bold.copyWith(
color: AppColor.textColor,
),
),
],
),
),
],
),
),
SizedBox(height: 16),
Container(
height: 135.h,
width: Get.width,
decoration: BoxDecoration(
color: AppColor.bgLight,
borderRadius: BorderRadius.circular(8),
),
child: Column(
spacing: 10,
children: [
SizedBox(
height: 100.h,
width: Get.width,
child: ListView.separated(
itemCount: 10,
padding: EdgeInsets.symmetric(horizontal: 12),
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
return Container(
width: 80.w,
height: 80.h,
decoration: BoxDecoration(
color: Color(0x33000000),
image: DecorationImage(
fit: BoxFit.cover,
image: NetworkImage(
"https://picsum.photos/150/150?random=${index * 2 + 1}",
),
),
borderRadius: BorderRadius.circular(8),
),
child: Stack(
fit: StackFit.expand,
children: [
Positioned(
top: 6,
left: 6,
child: Container(
width: 24.w,
height: 24.h,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Colors.white.withValues(alpha: 0.80),
borderRadius: BorderRadius.circular(4),
),
child: Assets.vec.trashSvg.svg(
width: 16.w,
height: 16.h,
colorFilter: ColorFilter.mode(
AppColor.redNormal,
BlendMode.srcIn,
),
),
),
),
],
),
);
},
separatorBuilder: (context, index) => SizedBox(width: 10),
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 18),
child: Row(
children: [
Text(
'انبار نهاده ها',
textAlign: TextAlign.right,
style: AppFonts.yekan14Bold.copyWith(
color: AppColor.textColor,
),
),
],
),
),
],
),
),
SizedBox(height: 16),
Container(
height: 135.h,
width: Get.width,
decoration: BoxDecoration(
color: AppColor.bgLight,
borderRadius: BorderRadius.circular(8),
),
child: Column(
spacing: 10,
children: [
SizedBox(
height: 100.h,
width: Get.width,
child: ListView.separated(
itemCount: 10,
padding: EdgeInsets.symmetric(horizontal: 12),
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
return Container(
width: 80.w,
height: 80.h,
decoration: BoxDecoration(
color: Color(0x33000000),
image: DecorationImage(
fit: BoxFit.cover,
image: NetworkImage(
"https://picsum.photos/150/150?random=${index * 3 + 1}",
),
),
borderRadius: BorderRadius.circular(8),
),
child: Stack(
fit: StackFit.expand,
children: [
Positioned(
top: 6,
left: 6,
child: Container(
width: 24.w,
height: 24.h,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Colors.white.withValues(alpha: 0.80),
borderRadius: BorderRadius.circular(4),
),
child: Assets.vec.trashSvg.svg(
width: 16.w,
height: 16.h,
colorFilter: ColorFilter.mode(
AppColor.redNormal,
BlendMode.srcIn,
),
),
),
),
],
),
);
},
separatorBuilder: (context, index) => SizedBox(width: 10),
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 18),
child: Row(
children: [
Text(
'تلفات',
textAlign: TextAlign.right,
style: AppFonts.yekan14Bold.copyWith(
color: AppColor.textColor,
),
),
],
),
),
],
),
),
],
);
}