feat: add gallery add icon and implement RStepper widget for poultry farm inspection
This commit is contained in:
@@ -11,7 +11,9 @@ class AuthRemoteDataSourceImp extends AuthRemoteDataSource {
|
||||
AuthRemoteDataSourceImp(this._httpClient);
|
||||
|
||||
@override
|
||||
Future<UserProfileModel?> login({required Map<String, dynamic> authRequest}) async {
|
||||
Future<UserProfileModel?> login({
|
||||
required Map<String, dynamic> authRequest,
|
||||
}) async {
|
||||
var res = await _httpClient.post<UserProfileModel?>(
|
||||
'/api/login/',
|
||||
data: authRequest,
|
||||
@@ -40,7 +42,7 @@ class AuthRemoteDataSourceImp extends AuthRemoteDataSource {
|
||||
@override
|
||||
Future<UserInfoModel?> getUserInfo(String phoneNumber) async {
|
||||
var res = await _httpClient.post<UserInfoModel?>(
|
||||
'https://userbackend.rasadyaar.ir/api/send_otp/',
|
||||
'https://userbackend.rasadyar.com/api/send_otp/',
|
||||
data: {"mobile": phoneNumber, "state": ""},
|
||||
fromJson: UserInfoModel.fromJson,
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
@@ -56,7 +58,10 @@ class AuthRemoteDataSourceImp extends AuthRemoteDataSource {
|
||||
await _httpClient.post(
|
||||
'/steward-app-login/',
|
||||
data: queryParameters,
|
||||
headers: {'Content-Type': 'application/json', 'Authorization': 'Bearer $token'},
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer $token',
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import '../widgets/step1_page.dart';
|
||||
|
||||
class PoultryFarmInspectionHomeLogic extends GetxController
|
||||
with GetTickerProviderStateMixin {
|
||||
RxInt selectedSegmentIndex = 0.obs;
|
||||
@@ -21,16 +23,39 @@ class PoultryFarmInspectionHomeLogic extends GetxController
|
||||
|
||||
RxInt selectedTabIndex = 0.obs;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
tabController = TabController(length: 4, vsync: this);
|
||||
}
|
||||
RxInt activeStepperIndex = 0.obs;
|
||||
|
||||
PageController pageController = PageController(initialPage: 0);
|
||||
|
||||
//step1
|
||||
|
||||
TextEditingController nameOfThePoultryFarmUnit = TextEditingController();
|
||||
|
||||
//step2
|
||||
RxInt sanitaryConditionOfTheHallIndex = (-1).obs;
|
||||
RxInt ventilationStatusIndex = (-1).obs;
|
||||
RxInt beddingStatusIndex = (-1).obs;
|
||||
RxInt waterQualityIndex = (-1).obs;
|
||||
RxInt fuelTypeIndex = (-1).obs;
|
||||
RxInt sampleTypeIndex = (-1).obs;
|
||||
|
||||
//step3
|
||||
RxInt grainQualityInputIndex = (-1).obs;
|
||||
RxInt generatorOperatingStatusIndex = (-1).obs;
|
||||
RxInt workerContractStatusIndex = (-1).obs;
|
||||
RxInt newBeneficiaryRequestIndex = (-1).obs;
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
|
||||
activeStepperIndex.listen((value) {
|
||||
pageController.animateToPage(
|
||||
value,
|
||||
duration: Duration(milliseconds: 300),
|
||||
curve: Curves.linear,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -56,5 +81,58 @@ class PoultryFarmInspectionHomeLogic extends GetxController
|
||||
return;
|
||||
}
|
||||
selectedTabIndex.value = index;
|
||||
}
|
||||
}
|
||||
|
||||
void clearForm() {
|
||||
nameOfThePoultryFarmUnit.clear();
|
||||
activeStepperIndex.value = 0;
|
||||
}
|
||||
|
||||
void setSanitaryConditionOfTheHallIndex(int index) {
|
||||
sanitaryConditionOfTheHallIndex.value =
|
||||
index == sanitaryConditionOfTheHallIndex.value ? -1 : index;
|
||||
}
|
||||
|
||||
void setFuelTypeIndex(int index) {
|
||||
fuelTypeIndex.value = index == fuelTypeIndex.value ? -1 : index;
|
||||
}
|
||||
|
||||
void setVentilationStatusIndex(int index) {
|
||||
ventilationStatusIndex.value = index == ventilationStatusIndex.value
|
||||
? -1
|
||||
: index;
|
||||
}
|
||||
|
||||
void setBeddingStatusIndex(int index) {
|
||||
beddingStatusIndex.value = index == beddingStatusIndex.value ? -1 : index;
|
||||
}
|
||||
|
||||
void setWaterQualityIndex(int index) {
|
||||
waterQualityIndex.value = index == waterQualityIndex.value ? -1 : index;
|
||||
}
|
||||
|
||||
void setSampleTypeIndex(int index) {
|
||||
sampleTypeIndex.value = index == sampleTypeIndex.value ? -1 : index;
|
||||
}
|
||||
|
||||
void setGrainQualityInputIndex(int index) {
|
||||
grainQualityInputIndex.value = index == grainQualityInputIndex.value
|
||||
? -1
|
||||
: index;
|
||||
}
|
||||
|
||||
void setGeneratorOperatingStatusIndex(int index) {
|
||||
generatorOperatingStatusIndex.value =
|
||||
index == generatorOperatingStatusIndex.value ? -1 : index;
|
||||
}
|
||||
|
||||
|
||||
void setWorkerContractStatusIndex(int index) {
|
||||
workerContractStatusIndex.value = index == workerContractStatusIndex.value ? -1 : index;
|
||||
}
|
||||
|
||||
|
||||
void setNewBeneficiaryRequestIndex(int index) {
|
||||
newBeneficiaryRequestIndex.value = index == newBeneficiaryRequestIndex.value ? -1 : index;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/info_card/info_card.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import '../widgets/cu_bottom_sheet.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
class PoultryFarmInspectionHomePage
|
||||
@@ -25,17 +26,39 @@ class PoultryFarmInspectionHomePage
|
||||
//TODO
|
||||
},
|
||||
backId: poultryFirstKey,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
child: Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
infoCards(),
|
||||
segmentWidget(),
|
||||
ObxValue((data) {
|
||||
return data.value == 0
|
||||
? activeInspectionWidget()
|
||||
: inactiveInspectionWidget();
|
||||
}, controller.selectedSegmentIndex),
|
||||
Positioned.fill(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
infoCards(),
|
||||
segmentWidget(),
|
||||
ObxValue((data) {
|
||||
return data.value == 0
|
||||
? activeInspectionWidget()
|
||||
: inactiveInspectionWidget();
|
||||
}, controller.selectedSegmentIndex),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Positioned(
|
||||
right: 10,
|
||||
bottom: 90.h,
|
||||
child: RFab.add(
|
||||
onPressed: () {
|
||||
Get.bottomSheet(
|
||||
addOrEditBottomSheet(controller),
|
||||
isScrollControlled: true,
|
||||
ignoreSafeArea: false,
|
||||
).then((value) => controller.clearForm(),);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -1067,5 +1090,5 @@ class PoultryFarmInspectionHomePage
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rasadyar_core/presentation/common/app_color.dart';
|
||||
|
||||
class PoultryFarmInspectionRootLogic extends GetxController {
|
||||
DateTime? _lastBackPressed;
|
||||
final pages = [
|
||||
Container(color: Colors.amber),
|
||||
Container(color: Colors.blue),
|
||||
Container(color: Colors.red),
|
||||
];
|
||||
|
||||
RxInt currentPage = 0.obs;
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
void changePage(int index) {
|
||||
currentPage.value = index;
|
||||
}
|
||||
|
||||
void popBackTaped() async {
|
||||
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,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class PoultryFarmInspectionRootPage extends GetView<PoultryFarmInspectionRootLogic> {
|
||||
const PoultryFarmInspectionRootPage({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.settingSvg.path,
|
||||
isSelected: controller.currentPage.value == 0,
|
||||
onTap: () {
|
||||
controller.changePage(0);
|
||||
},
|
||||
),
|
||||
RBottomNavigationItem(
|
||||
label: 'خانه',
|
||||
icon: Assets.vec.homeSvg.path,
|
||||
isSelected: controller.currentPage.value == 1,
|
||||
onTap: () {
|
||||
controller.changePage(1);
|
||||
},
|
||||
),
|
||||
RBottomNavigationItem(
|
||||
label: 'پروفایل',
|
||||
icon: Assets.vec.profileCircleSvg.path,
|
||||
isSelected: controller.currentPage.value == 2,
|
||||
onTap: () {
|
||||
controller.changePage(3);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}, controller.currentPage),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/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,
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/poultry_farm_inspection/widgets/step2_page.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import '../home/logic.dart';
|
||||
import 'step1_page.dart';
|
||||
import 'step3_page.dart';
|
||||
|
||||
Widget addOrEditBottomSheet(PoultryFarmInspectionHomeLogic controller) {
|
||||
List<Widget> pages = [
|
||||
step1Page(controller),
|
||||
step2Page(controller),
|
||||
step3Page(controller),
|
||||
Container(color: Colors.green),
|
||||
];
|
||||
|
||||
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 < 3) {
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/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: 500.h,
|
||||
clipBehavior: Clip.none,
|
||||
width: Get.width,
|
||||
child: farmInfoWidget(
|
||||
controller: controller,
|
||||
title: 'اطلاعات پایه واحد',
|
||||
child: basicUnitInformation(controller),
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(height: 30.h),
|
||||
|
||||
Container(
|
||||
height: 340.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,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,530 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/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: 645.h,
|
||||
clipBehavior: Clip.none,
|
||||
width: Get.width,
|
||||
child: farmInfoWidget(
|
||||
controller: controller,
|
||||
title: 'وضعیت عمومی سالن',
|
||||
child: generalConditionOfTheHall(controller),
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(height: 30.h),
|
||||
|
||||
Container(
|
||||
height: 410.h,
|
||||
clipBehavior: Clip.none,
|
||||
width: Get.width,
|
||||
child: farmInfoWidget(
|
||||
controller: controller,
|
||||
title: 'تلفات',
|
||||
child: casualtiesInformation(controller),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 24.h),
|
||||
|
||||
Container(
|
||||
height: 380.h,
|
||||
clipBehavior: Clip.none,
|
||||
width: Get.width,
|
||||
child: farmInfoWidget(
|
||||
controller: controller,
|
||||
title: 'بیماریها و وضعیت سلامت',
|
||||
child: diseasesAndHealthInformation(controller),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Column generalConditionOfTheHall(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 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,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,755 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/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: 350.h,
|
||||
clipBehavior: Clip.none,
|
||||
width: Get.width,
|
||||
child: farmInfoWidget(
|
||||
controller: controller,
|
||||
title: 'نهاده و خوراک',
|
||||
child: agriculturalInput(controller),
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(height: 30.h),
|
||||
|
||||
Container(
|
||||
height: 410.h,
|
||||
clipBehavior: Clip.none,
|
||||
width: Get.width,
|
||||
child: farmInfoWidget(
|
||||
controller: controller,
|
||||
title: 'زیرساخت و انرژی',
|
||||
child: infrastructureAndEnergy(controller),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 24.h),
|
||||
|
||||
Container(
|
||||
height: 380.h,
|
||||
clipBehavior: Clip.none,
|
||||
width: Get.width,
|
||||
child: farmInfoWidget(
|
||||
controller: controller,
|
||||
title: 'نیروی انسانی',
|
||||
child: humanResources(controller),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 24.h),
|
||||
|
||||
Container(
|
||||
height: 380.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 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),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -229,14 +229,14 @@ void main() {
|
||||
data: expectedUserInfo,
|
||||
statusCode: 200,
|
||||
requestOptions: RequestOptions(
|
||||
path: 'https://userbackend.rasadyaar.ir/api/send_otp/',
|
||||
path: 'https://userbackend.rasadyar.com/api/send_otp/',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
when(
|
||||
() => mockDioRemote.post<UserInfoModel?>(
|
||||
'https://userbackend.rasadyaar.ir/api/send_otp/',
|
||||
'https://userbackend.rasadyar.com/api/send_otp/',
|
||||
data: {"mobile": phoneNumber, "state": ""},
|
||||
fromJson: any(named: 'fromJson'),
|
||||
headers: any(named: 'headers'),
|
||||
@@ -250,7 +250,7 @@ void main() {
|
||||
expect(result, equals(expectedUserInfo));
|
||||
verify(
|
||||
() => mockDioRemote.post<UserInfoModel?>(
|
||||
'https://userbackend.rasadyaar.ir/api/send_otp/',
|
||||
'https://userbackend.rasadyar.com/api/send_otp/',
|
||||
data: {"mobile": phoneNumber, "state": ""},
|
||||
fromJson: UserInfoModel.fromJson,
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
@@ -267,14 +267,14 @@ void main() {
|
||||
data: null,
|
||||
statusCode: 404,
|
||||
requestOptions: RequestOptions(
|
||||
path: 'https://userbackend.rasadyaar.ir/api/send_otp/',
|
||||
path: 'https://userbackend.rasadyar.com/api/send_otp/',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
when(
|
||||
() => mockDioRemote.post<UserInfoModel?>(
|
||||
'https://userbackend.rasadyaar.ir/api/send_otp/',
|
||||
'https://userbackend.rasadyar.com/api/send_otp/',
|
||||
data: {"mobile": phoneNumber, "state": ""},
|
||||
fromJson: any(named: 'fromJson'),
|
||||
headers: any(named: 'headers'),
|
||||
@@ -288,7 +288,7 @@ void main() {
|
||||
expect(result, isNull);
|
||||
verify(
|
||||
() => mockDioRemote.post<UserInfoModel?>(
|
||||
'https://userbackend.rasadyaar.ir/api/send_otp/',
|
||||
'https://userbackend.rasadyar.com/api/send_otp/',
|
||||
data: {"mobile": phoneNumber, "state": ""},
|
||||
fromJson: UserInfoModel.fromJson,
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
|
||||
Reference in New Issue
Block a user