fix : routing in poultry sience

This commit is contained in:
2025-12-08 10:29:16 +03:30
parent 9b68cb6bc3
commit 2f4edc1b6e

View File

@@ -1,5 +1,6 @@
import 'package:flutter/cupertino.dart' hide LinearGradient; import 'package:flutter/cupertino.dart' hide LinearGradient;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/features/poultry_science/presentation/routes/routes.dart';
import 'package:rasadyar_chicken/presentation/routes/routes.dart'; import 'package:rasadyar_chicken/presentation/routes/routes.dart';
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart'; import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart'; import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
@@ -34,13 +35,18 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: Border.all(width: 0.50, color: const Color(0xFFA9A9A9)), border: Border.all(
width: 0.50,
color: const Color(0xFFA9A9A9),
),
), ),
child: ObxValue((data) { child: ObxValue((data) {
return AnimatedSize( return AnimatedSize(
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
child: data.value ? mainItemWidget() : mainItemWidgetExpanded(), child: data.value
? mainItemWidget()
: mainItemWidgetExpanded(),
); );
}, controller.isExpanded), }, controller.isExpanded),
), ),
@@ -52,7 +58,10 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: Border.all(width: 0.50, color: const Color(0xFFA9A9A9)), border: Border.all(
width: 0.50,
color: const Color(0xFFA9A9A9),
),
), ),
padding: EdgeInsets.symmetric(horizontal: 8), padding: EdgeInsets.symmetric(horizontal: 8),
child: Row( child: Row(
@@ -61,12 +70,17 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
Assets.vec.chicken2Svg.svg( Assets.vec.chicken2Svg.svg(
width: 16.w, width: 16.w,
height: 16.h, height: 16.h,
colorFilter: ColorFilter.mode(AppColor.blueDark, BlendMode.srcIn), colorFilter: ColorFilter.mode(
AppColor.blueDark,
BlendMode.srcIn,
),
), ),
Text( Text(
'اطلاعات فارم‌ها', 'اطلاعات فارم‌ها',
textAlign: TextAlign.right, textAlign: TextAlign.right,
style: AppFonts.yekan16Bold.copyWith(color: AppColor.iconColor), style: AppFonts.yekan16Bold.copyWith(
color: AppColor.iconColor,
),
), ),
], ],
), ),
@@ -88,7 +102,11 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [SizedBox(height: 8), firstTagInformation(), secondTagInformation()], children: [
SizedBox(height: 8),
firstTagInformation(),
secondTagInformation(),
],
), ),
); );
} }
@@ -136,7 +154,11 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
firstTagInformation(), firstTagInformation(),
Row( Row(
children: [ children: [
Text('اطلاعات جوجه‌ریزی', textAlign: TextAlign.right, style: AppFonts.yekan16), Text(
'اطلاعات جوجه‌ریزی',
textAlign: TextAlign.right,
style: AppFonts.yekan16,
),
], ],
), ),
secondTagInformation(), secondTagInformation(),
@@ -237,7 +259,10 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
onTap: () async { onTap: () async {
controller.rootLogic.currentPage.value = 0; controller.rootLogic.currentPage.value = 0;
Get.toNamed(ChickenRoutes.inspectionPoultryScience, id: poultryFirstKey); Get.toNamed(
PoultryScienceRoutes.inspectionPoultryScience,
id: poultryFirstKey,
);
}, },
), ),
@@ -250,7 +275,10 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
textColor: AppColor.textColor, textColor: AppColor.textColor,
onTap: () async { onTap: () async {
controller.rootLogic.currentPage.value = 0; controller.rootLogic.currentPage.value = 0;
Get.toNamed(ChickenRoutes.genocidePoultryScience, id: poultryFirstKey); Get.toNamed(
PoultryScienceRoutes.genocidePoultryScience,
id: poultryFirstKey,
);
}, },
), ),
widelyUsed( widelyUsed(
@@ -262,7 +290,10 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
isOnEdit: false, isOnEdit: false,
onTap: () async { onTap: () async {
controller.rootLogic.currentPage.value = 0; controller.rootLogic.currentPage.value = 0;
Get.toNamed(ChickenRoutes.farmPoultryScience, id: poultryFirstKey); Get.toNamed(
PoultryScienceRoutes.farmPoultryScience,
id: poultryFirstKey,
);
}, },
), ),
@@ -275,7 +306,10 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
textColor: AppColor.textColor, textColor: AppColor.textColor,
onTap: () async { onTap: () async {
controller.rootLogic.currentPage.value = 0; controller.rootLogic.currentPage.value = 0;
Get.toNamed(ChickenRoutes.activeHatchingPoultryScience, id: poultryFirstKey); Get.toNamed(
PoultryScienceRoutes.activeHatchingPoultryScience,
id: poultryFirstKey,
);
}, },
), ),
], ],
@@ -291,7 +325,11 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: Border.all(width: 0.50, color: const Color(0xFFA9A9A9)), border: Border.all(width: 0.50, color: const Color(0xFFA9A9A9)),
), ),
child: Text('پر کاربردها', textAlign: TextAlign.right, style: AppFonts.yekan16), child: Text(
'پر کاربردها',
textAlign: TextAlign.right,
style: AppFonts.yekan16,
),
), ),
), ),
], ],
@@ -324,19 +362,26 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
decoration: ShapeDecoration( decoration: ShapeDecoration(
color: cardColor ?? Color(0xFFBECDFF), color: cardColor ?? Color(0xFFBECDFF),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
), ),
child: Container( child: Container(
width: 40, width: 40,
height: 40, height: 40,
decoration: ShapeDecoration( decoration: ShapeDecoration(
color: labelColor ?? AppColor.blueNormal, color: labelColor ?? AppColor.blueNormal,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
), ),
child: SvgGenImage.vec(iconPath).svg( child: SvgGenImage.vec(iconPath).svg(
width: 24, width: 24,
height: 24, height: 24,
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn), colorFilter: ColorFilter.mode(
Colors.white,
BlendMode.srcIn,
),
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@@ -349,7 +394,9 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
decoration: ShapeDecoration( decoration: ShapeDecoration(
color: Colors.white60, color: Colors.white60,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
), ),
), ),
), ),
@@ -369,9 +416,16 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
child: Container( child: Container(
width: 16, width: 16,
height: 16, height: 16,
decoration: BoxDecoration(shape: BoxShape.circle, color: Colors.white), decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.white,
),
alignment: Alignment.center, alignment: Alignment.center,
child: Icon(CupertinoIcons.minus, color: AppColor.error, size: 15), child: Icon(
CupertinoIcons.minus,
color: AppColor.error,
size: 15,
),
), ),
), ),
), ),
@@ -382,7 +436,9 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
), ),
Text( Text(
title, title,
style: AppFonts.yekan10Bold.copyWith(color: textColor ?? AppColor.blueNormal), style: AppFonts.yekan10Bold.copyWith(
color: textColor ?? AppColor.blueNormal,
),
), ),
], ],
), ),