feat: add gallery add icon and implement RStepper widget for poultry farm inspection
This commit is contained in:
10
.vscode/launch.json
vendored
10
.vscode/launch.json
vendored
@@ -4,23 +4,25 @@
|
|||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "rasadyar_app",
|
"name": "rasadyar_app",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"type": "dart"
|
"type": "dart",
|
||||||
|
"program": "lib/main.dart",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "rasadyar_app (profile mode)",
|
"name": "rasadyar_app (profile mode)",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"type": "dart",
|
"type": "dart",
|
||||||
"flutterMode": "profile"
|
"flutterMode": "profile",
|
||||||
|
"program": "lib/main.dart",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "rasadyar_app (release mode)",
|
"name": "rasadyar_app (release mode)",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"type": "dart",
|
"type": "dart",
|
||||||
"flutterMode": "release"
|
"flutterMode": "release",
|
||||||
|
"program": "lib/main.dart",
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
7
assets/icons/gallery_add.svg
Normal file
7
assets/icons/gallery_add.svg
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M12.9163 15.8346C10.383 15.8346 8.33301 13.7846 8.33301 11.2513C8.33301 8.71797 10.383 6.66797 12.9163 6.66797C15.4497 6.66797 17.4997 8.71797 17.4997 11.2513C17.4997 13.7846 15.4497 15.8346 12.9163 15.8346ZM12.9163 9.16797C11.7663 9.16797 10.833 10.1013 10.833 11.2513C10.833 12.4013 11.7663 13.3346 12.9163 13.3346C14.0663 13.3346 14.9997 12.4013 14.9997 11.2513C14.9997 10.1013 14.0663 9.16797 12.9163 9.16797Z" fill="#818181"/>
|
||||||
|
<path d="M22.9167 35.8333H12.9167C3.86667 35.8333 0 31.9667 0 22.9167V12.9167C0 3.86667 3.86667 0 12.9167 0H19.5833C20.2667 0 20.8333 0.566667 20.8333 1.25C20.8333 1.93333 20.2667 2.5 19.5833 2.5H12.9167C5.23333 2.5 2.5 5.23333 2.5 12.9167V22.9167C2.5 30.6 5.23333 33.3333 12.9167 33.3333H22.9167C30.6 33.3333 33.3333 30.6 33.3333 22.9167V14.5833C33.3333 13.9 33.9 13.3333 34.5833 13.3333C35.2667 13.3333 35.8333 13.9 35.8333 14.5833V22.9167C35.8333 31.9667 31.9667 35.8333 22.9167 35.8333Z" fill="#818181"/>
|
||||||
|
<path d="M33.3327 7.5H24.166C23.4827 7.5 22.916 6.93333 22.916 6.25C22.916 5.56667 23.4827 5 24.166 5H33.3327C34.016 5 34.5827 5.56667 34.5827 6.25C34.5827 6.93333 34.016 7.5 33.3327 7.5Z" fill="#818181"/>
|
||||||
|
<path d="M28.75 12.0846C28.0667 12.0846 27.5 11.518 27.5 10.8346V1.66797C27.5 0.984635 28.0667 0.417969 28.75 0.417969C29.4333 0.417969 30 0.984635 30 1.66797V10.8346C30 11.518 29.4333 12.0846 28.75 12.0846Z" fill="#818181"/>
|
||||||
|
<path d="M2.36585 30.7477C1.96585 30.7477 1.56585 30.5477 1.33252 30.1977C0.949186 29.631 1.09919 28.8477 1.66585 28.4643L9.88252 22.9477C11.6825 21.7477 14.1659 21.881 15.7992 23.2643L16.3492 23.7477C17.1825 24.4643 18.5992 24.4643 19.4159 23.7477L26.3492 17.7977C28.1325 16.281 30.8992 16.281 32.6825 17.7977L35.3992 20.131C35.9159 20.581 35.9825 21.3643 35.5325 21.8977C35.0825 22.4143 34.2992 22.481 33.7659 22.031L31.0492 19.6977C30.2159 18.981 28.7992 18.981 27.9825 19.6977L21.0492 25.6477C19.2825 27.1643 16.4992 27.1643 14.7159 25.6477L14.1659 25.1643C13.3992 24.5143 12.1325 24.4477 11.2825 25.031L3.08252 30.5477C2.84919 30.681 2.59919 30.7477 2.36585 30.7477Z" fill="#818181"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.1 KiB |
BIN
assets/vec/gallery_add.svg.vec
Normal file
BIN
assets/vec/gallery_add.svg.vec
Normal file
Binary file not shown.
@@ -11,7 +11,9 @@ class AuthRemoteDataSourceImp extends AuthRemoteDataSource {
|
|||||||
AuthRemoteDataSourceImp(this._httpClient);
|
AuthRemoteDataSourceImp(this._httpClient);
|
||||||
|
|
||||||
@override
|
@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?>(
|
var res = await _httpClient.post<UserProfileModel?>(
|
||||||
'/api/login/',
|
'/api/login/',
|
||||||
data: authRequest,
|
data: authRequest,
|
||||||
@@ -40,7 +42,7 @@ class AuthRemoteDataSourceImp extends AuthRemoteDataSource {
|
|||||||
@override
|
@override
|
||||||
Future<UserInfoModel?> getUserInfo(String phoneNumber) async {
|
Future<UserInfoModel?> getUserInfo(String phoneNumber) async {
|
||||||
var res = await _httpClient.post<UserInfoModel?>(
|
var res = await _httpClient.post<UserInfoModel?>(
|
||||||
'https://userbackend.rasadyaar.ir/api/send_otp/',
|
'https://userbackend.rasadyar.com/api/send_otp/',
|
||||||
data: {"mobile": phoneNumber, "state": ""},
|
data: {"mobile": phoneNumber, "state": ""},
|
||||||
fromJson: UserInfoModel.fromJson,
|
fromJson: UserInfoModel.fromJson,
|
||||||
headers: {'Content-Type': 'application/json'},
|
headers: {'Content-Type': 'application/json'},
|
||||||
@@ -56,7 +58,10 @@ class AuthRemoteDataSourceImp extends AuthRemoteDataSource {
|
|||||||
await _httpClient.post(
|
await _httpClient.post(
|
||||||
'/steward-app-login/',
|
'/steward-app-login/',
|
||||||
data: queryParameters,
|
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:flutter/material.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
|
import '../widgets/step1_page.dart';
|
||||||
|
|
||||||
class PoultryFarmInspectionHomeLogic extends GetxController
|
class PoultryFarmInspectionHomeLogic extends GetxController
|
||||||
with GetTickerProviderStateMixin {
|
with GetTickerProviderStateMixin {
|
||||||
RxInt selectedSegmentIndex = 0.obs;
|
RxInt selectedSegmentIndex = 0.obs;
|
||||||
@@ -21,16 +23,39 @@ class PoultryFarmInspectionHomeLogic extends GetxController
|
|||||||
|
|
||||||
RxInt selectedTabIndex = 0.obs;
|
RxInt selectedTabIndex = 0.obs;
|
||||||
|
|
||||||
@override
|
RxInt activeStepperIndex = 0.obs;
|
||||||
void onInit() {
|
|
||||||
super.onInit();
|
PageController pageController = PageController(initialPage: 0);
|
||||||
tabController = TabController(length: 4, vsync: this);
|
|
||||||
}
|
//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
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
// TODO: implement onReady
|
|
||||||
super.onReady();
|
super.onReady();
|
||||||
|
|
||||||
|
activeStepperIndex.listen((value) {
|
||||||
|
pageController.animateToPage(
|
||||||
|
value,
|
||||||
|
duration: Duration(milliseconds: 300),
|
||||||
|
curve: Curves.linear,
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -56,5 +81,58 @@ class PoultryFarmInspectionHomeLogic extends GetxController
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
selectedTabIndex.value = index;
|
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_chicken/presentation/widget/info_card/info_card.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
|
import '../widgets/cu_bottom_sheet.dart';
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
|
|
||||||
class PoultryFarmInspectionHomePage
|
class PoultryFarmInspectionHomePage
|
||||||
@@ -25,17 +26,39 @@ class PoultryFarmInspectionHomePage
|
|||||||
//TODO
|
//TODO
|
||||||
},
|
},
|
||||||
backId: poultryFirstKey,
|
backId: poultryFirstKey,
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
child: Stack(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
fit: StackFit.expand,
|
||||||
children: [
|
children: [
|
||||||
infoCards(),
|
Positioned.fill(
|
||||||
segmentWidget(),
|
child: Column(
|
||||||
ObxValue((data) {
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
return data.value == 0
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
? activeInspectionWidget()
|
children: [
|
||||||
: inactiveInspectionWidget();
|
infoCards(),
|
||||||
}, controller.selectedSegmentIndex),
|
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,
|
data: expectedUserInfo,
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
requestOptions: RequestOptions(
|
requestOptions: RequestOptions(
|
||||||
path: 'https://userbackend.rasadyaar.ir/api/send_otp/',
|
path: 'https://userbackend.rasadyar.com/api/send_otp/',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
when(
|
when(
|
||||||
() => mockDioRemote.post<UserInfoModel?>(
|
() => mockDioRemote.post<UserInfoModel?>(
|
||||||
'https://userbackend.rasadyaar.ir/api/send_otp/',
|
'https://userbackend.rasadyar.com/api/send_otp/',
|
||||||
data: {"mobile": phoneNumber, "state": ""},
|
data: {"mobile": phoneNumber, "state": ""},
|
||||||
fromJson: any(named: 'fromJson'),
|
fromJson: any(named: 'fromJson'),
|
||||||
headers: any(named: 'headers'),
|
headers: any(named: 'headers'),
|
||||||
@@ -250,7 +250,7 @@ void main() {
|
|||||||
expect(result, equals(expectedUserInfo));
|
expect(result, equals(expectedUserInfo));
|
||||||
verify(
|
verify(
|
||||||
() => mockDioRemote.post<UserInfoModel?>(
|
() => mockDioRemote.post<UserInfoModel?>(
|
||||||
'https://userbackend.rasadyaar.ir/api/send_otp/',
|
'https://userbackend.rasadyar.com/api/send_otp/',
|
||||||
data: {"mobile": phoneNumber, "state": ""},
|
data: {"mobile": phoneNumber, "state": ""},
|
||||||
fromJson: UserInfoModel.fromJson,
|
fromJson: UserInfoModel.fromJson,
|
||||||
headers: {'Content-Type': 'application/json'},
|
headers: {'Content-Type': 'application/json'},
|
||||||
@@ -267,14 +267,14 @@ void main() {
|
|||||||
data: null,
|
data: null,
|
||||||
statusCode: 404,
|
statusCode: 404,
|
||||||
requestOptions: RequestOptions(
|
requestOptions: RequestOptions(
|
||||||
path: 'https://userbackend.rasadyaar.ir/api/send_otp/',
|
path: 'https://userbackend.rasadyar.com/api/send_otp/',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
when(
|
when(
|
||||||
() => mockDioRemote.post<UserInfoModel?>(
|
() => mockDioRemote.post<UserInfoModel?>(
|
||||||
'https://userbackend.rasadyaar.ir/api/send_otp/',
|
'https://userbackend.rasadyar.com/api/send_otp/',
|
||||||
data: {"mobile": phoneNumber, "state": ""},
|
data: {"mobile": phoneNumber, "state": ""},
|
||||||
fromJson: any(named: 'fromJson'),
|
fromJson: any(named: 'fromJson'),
|
||||||
headers: any(named: 'headers'),
|
headers: any(named: 'headers'),
|
||||||
@@ -288,7 +288,7 @@ void main() {
|
|||||||
expect(result, isNull);
|
expect(result, isNull);
|
||||||
verify(
|
verify(
|
||||||
() => mockDioRemote.post<UserInfoModel?>(
|
() => mockDioRemote.post<UserInfoModel?>(
|
||||||
'https://userbackend.rasadyaar.ir/api/send_otp/',
|
'https://userbackend.rasadyar.com/api/send_otp/',
|
||||||
data: {"mobile": phoneNumber, "state": ""},
|
data: {"mobile": phoneNumber, "state": ""},
|
||||||
fromJson: UserInfoModel.fromJson,
|
fromJson: UserInfoModel.fromJson,
|
||||||
headers: {'Content-Type': 'application/json'},
|
headers: {'Content-Type': 'application/json'},
|
||||||
|
|||||||
@@ -389,6 +389,7 @@ class AppColor {
|
|||||||
static const Color bgIcon = Color(0xFF797979); // #797979
|
static const Color bgIcon = Color(0xFF797979); // #797979
|
||||||
static const Color bgDark = Color(0xFF979797); // #083940 rgb(8, 57, 64)
|
static const Color bgDark = Color(0xFF979797); // #083940 rgb(8, 57, 64)
|
||||||
static const Color textColor = Color(0xFF5B5B5B); // #083940 rgb(8, 57, 64)
|
static const Color textColor = Color(0xFF5B5B5B); // #083940 rgb(8, 57, 64)
|
||||||
|
static const Color textColor2 = Color(0xFF636363); // #636363 rgb(99, 99, 99)
|
||||||
static const Color labelTextColor = Color(0xFF808080);
|
static const Color labelTextColor = Color(0xFF808080);
|
||||||
static const Color textColorLight = Color(0xFFB2B2B2);
|
static const Color textColorLight = Color(0xFFB2B2B2);
|
||||||
static const Color iconColor = Color(0xFF444444); // #444444 rgb(68, 68, 68)
|
static const Color iconColor = Color(0xFF444444); // #444444 rgb(68, 68, 68)
|
||||||
|
|||||||
@@ -187,6 +187,9 @@ class $AssetsIconsGen {
|
|||||||
/// File path: assets/icons/filter_outline.svg
|
/// File path: assets/icons/filter_outline.svg
|
||||||
SvgGenImage get filterOutline => const SvgGenImage('assets/icons/filter_outline.svg');
|
SvgGenImage get filterOutline => const SvgGenImage('assets/icons/filter_outline.svg');
|
||||||
|
|
||||||
|
/// File path: assets/icons/gallery_add.svg
|
||||||
|
SvgGenImage get galleryAdd => const SvgGenImage('assets/icons/gallery_add.svg');
|
||||||
|
|
||||||
/// File path: assets/icons/gps.svg
|
/// File path: assets/icons/gps.svg
|
||||||
SvgGenImage get gps => const SvgGenImage('assets/icons/gps.svg');
|
SvgGenImage get gps => const SvgGenImage('assets/icons/gps.svg');
|
||||||
|
|
||||||
@@ -418,6 +421,7 @@ class $AssetsIconsGen {
|
|||||||
farms,
|
farms,
|
||||||
filter,
|
filter,
|
||||||
filterOutline,
|
filterOutline,
|
||||||
|
galleryAdd,
|
||||||
gps,
|
gps,
|
||||||
hashtag,
|
hashtag,
|
||||||
home,
|
home,
|
||||||
@@ -674,6 +678,9 @@ class $AssetsVecGen {
|
|||||||
/// File path: assets/vec/filter_outline.svg.vec
|
/// File path: assets/vec/filter_outline.svg.vec
|
||||||
SvgGenImage get filterOutlineSvg => const SvgGenImage.vec('assets/vec/filter_outline.svg.vec');
|
SvgGenImage get filterOutlineSvg => const SvgGenImage.vec('assets/vec/filter_outline.svg.vec');
|
||||||
|
|
||||||
|
/// File path: assets/vec/gallery_add.svg.vec
|
||||||
|
SvgGenImage get galleryAddSvg => const SvgGenImage.vec('assets/vec/gallery_add.svg.vec');
|
||||||
|
|
||||||
/// File path: assets/vec/gps.svg.vec
|
/// File path: assets/vec/gps.svg.vec
|
||||||
SvgGenImage get gpsSvg => const SvgGenImage.vec('assets/vec/gps.svg.vec');
|
SvgGenImage get gpsSvg => const SvgGenImage.vec('assets/vec/gps.svg.vec');
|
||||||
|
|
||||||
@@ -905,6 +912,7 @@ class $AssetsVecGen {
|
|||||||
farmsSvg,
|
farmsSvg,
|
||||||
filterSvg,
|
filterSvg,
|
||||||
filterOutlineSvg,
|
filterOutlineSvg,
|
||||||
|
galleryAddSvg,
|
||||||
gpsSvg,
|
gpsSvg,
|
||||||
hashtagSvg,
|
hashtagSvg,
|
||||||
homeSvg,
|
homeSvg,
|
||||||
|
|||||||
55
packages/core/lib/presentation/widget/stepper/r_stepper.dart
Normal file
55
packages/core/lib/presentation/widget/stepper/r_stepper.dart
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
|
class RStepper extends StatelessWidget {
|
||||||
|
const RStepper({
|
||||||
|
super.key,
|
||||||
|
required this.activeStepColor,
|
||||||
|
this.deactiveStepColor,
|
||||||
|
this.dividerColor,
|
||||||
|
required this.stepsCount,
|
||||||
|
required this.activeStep,
|
||||||
|
});
|
||||||
|
|
||||||
|
final Color activeStepColor;
|
||||||
|
final Color? deactiveStepColor;
|
||||||
|
final Color? dividerColor;
|
||||||
|
final int stepsCount;
|
||||||
|
final int activeStep;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
|
||||||
|
|
||||||
|
return SizedBox(
|
||||||
|
height: 24.h,
|
||||||
|
width: Get.width,
|
||||||
|
child: Row(
|
||||||
|
children: List.generate(stepsCount, (index) {
|
||||||
|
final isFirst = index == 0;
|
||||||
|
return SizedBox(
|
||||||
|
width: (Get.width) / (stepsCount - 1),
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: index == activeStep
|
||||||
|
? activeStepColor
|
||||||
|
: deactiveStepColor ?? AppColor.whiteNormalActive,
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
),
|
||||||
|
width: 24.w,
|
||||||
|
height: 24.h,
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
(index + 1).toString(),
|
||||||
|
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -45,6 +45,7 @@ export 'overlay_dropdown_widget/resource_overlay_dropdown.dart';
|
|||||||
export 'pagination/pagination_from_until.dart';
|
export 'pagination/pagination_from_until.dart';
|
||||||
export 'pagination/show_more.dart';
|
export 'pagination/show_more.dart';
|
||||||
export 'slider/slider.dart';
|
export 'slider/slider.dart';
|
||||||
|
export 'stepper/r_stepper.dart';
|
||||||
export 'tabs/new_tab.dart';
|
export 'tabs/new_tab.dart';
|
||||||
export 'tabs/r_segment.dart';
|
export 'tabs/r_segment.dart';
|
||||||
export 'tabs/tab.dart';
|
export 'tabs/tab.dart';
|
||||||
|
|||||||
Reference in New Issue
Block a user