fix : some ui and

This commit is contained in:
2025-09-23 11:18:33 +03:30
parent e176671812
commit 884b4f1556
21 changed files with 271 additions and 101 deletions

View File

@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/models/response/poultry_farm/poultry_farm.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/home/logic.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/logic.dart';
import 'package:rasadyar_core/core.dart';
@@ -14,7 +13,7 @@ class FarmLogic extends GetxController {
labelTitle: 'کل فارم ها',
isLoading: true,
labelVecIcon: Assets.vec.cubeScanSvg.path,
blendMode: BlendMode.dst,
iconColor: AppColor.blueNormalOld,
valueBgColor: Colors.white,
labelGradient: LinearGradient(
begin: Alignment.topCenter,
@@ -90,10 +89,7 @@ class FarmLogic extends GetxController {
count: res?.count ?? 0,
next: res?.next,
previous: res?.previous,
results: [
...(farmList.value.data?.results ?? []),
...?res?.results,
],
results: [...(farmList.value.data?.results ?? []), ...?res?.results],
),
);
}
@@ -101,6 +97,7 @@ class FarmLogic extends GetxController {
onError: (error, stackTrace) {},
);
}
void toggleExpanded(int index) {
expandedIndex.value = expandedIndex.value == index ? -1 : index;
}

View File

@@ -68,7 +68,7 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
colorFilter: ColorFilter.mode(AppColor.iconColor, BlendMode.srcIn),
),
Text(
'فارم های مرغ گوشتی',
'اطلاعات فارمها',
textAlign: TextAlign.right,
style: AppFonts.yekan16.copyWith(color: AppColor.iconColor),
),
@@ -173,7 +173,7 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
firstTagInformation(),
Row(
children: [
Text('اطلاعات جوجه ریزی', textAlign: TextAlign.right, style: AppFonts.yekan16),
Text('اطلاعات جوجهریزی', textAlign: TextAlign.right, style: AppFonts.yekan16),
],
),
secondTagInformation(),
@@ -303,7 +303,7 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
),
widelyUsed(
title: 'جوجه ریزی فعال',
title: 'جوجهریزی فعال',
iconPath: Assets.vec.boxTickSvg.path,
isOnEdit: false,
cardColor: Color(0xFFD9BEFF),
@@ -322,7 +322,7 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
right: 11,
child: Container(
color: Colors.white,
child: Text('پر کاربرد ها', textAlign: TextAlign.right, style: AppFonts.yekan16),
child: Text('پر کاربردها', textAlign: TextAlign.right, style: AppFonts.yekan16),
),
),
],

View File

@@ -8,7 +8,6 @@ import 'package:rasadyar_chicken/data/models/response/kill_request_poultry/kill_
import 'package:rasadyar_chicken/data/models/response/poultry_hatching/poultry_hatching.dart';
import 'package:rasadyar_chicken/data/models/response/sell_for_freezing/sell_for_freezing.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/logic.dart';
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
import 'package:rasadyar_core/core.dart';
class KillingRegistrationLogic extends GetxController {
@@ -89,7 +88,6 @@ class KillingRegistrationLogic extends GetxController {
);
}
@override
void onClose() {
super.onClose();
@@ -107,7 +105,8 @@ class KillingRegistrationLogic extends GetxController {
quantityKillsController.addListener(() {
quantityKillsIsCompleted.value = quantityKillsController.text.trim().isNotEmpty;
if (averageWeightKillsController.text.isNotEmpty && quantityKillsController.text.trim().isNotEmpty) {
if (averageWeightKillsController.text.isNotEmpty &&
quantityKillsController.text.trim().isNotEmpty) {
generatedApprovedPrice.value = calculateApprovedPrice().toInt();
priceFreeSaleController.text = generatedApprovedPrice.value.separatedByComma;
@@ -120,10 +119,10 @@ class KillingRegistrationLogic extends GetxController {
});
averageWeightKillsController.addListener(() {
averageWeightKillsIsCompleted.value = averageWeightKillsController.text.trim().isNotEmpty;
if (averageWeightKillsController.text.trim().isNotEmpty && quantityKillsController.text.trim().isNotEmpty) {
if (averageWeightKillsController.text.trim().isNotEmpty &&
quantityKillsController.text.trim().isNotEmpty) {
generatedApprovedPrice.value = calculateApprovedPrice().toInt();
priceFreeSaleController.text = generatedApprovedPrice.value.separatedByComma;
checkSubmitButton();
@@ -359,9 +358,8 @@ class KillingRegistrationLogic extends GetxController {
'ثبت با موفقیت انجام شد',
durationInSeconds: 2,
onDismissed: () async {
fLog('Kill Registration onDismissed');
Future.delayed(Duration(milliseconds: 300), () {
Get.back(id: poultryFirstKey);
Get.back();
});
},
);
@@ -408,6 +406,4 @@ class KillingRegistrationLogic extends GetxController {
poultryHatchingList.value = Resource<List<PoultryHatching>>.success([]);
killHouseList.value = Resource<List<KillHousePoultry>>.success([]);
}
}

View File

@@ -40,13 +40,7 @@ class KillingRegistrationPage extends GetView<KillingRegistrationLogic> {
ObxValue((data) {
return Visibility(
visible: data.value,
child: Column(
children: [
averageWeightKillsWidget(),
],
),
child: Column(children: [averageWeightKillsWidget()]),
);
}, controller.quantityKillsIsCompleted),
@@ -55,19 +49,15 @@ class KillingRegistrationPage extends GetView<KillingRegistrationLogic> {
visible: data.value,
child: Column(
children: [
saleTypeWidget(),
priceWidget(),
buyerListWidget(),
slaughterhouseSelectedWidget(),
submitButtonWidget(),
],
),
);
}, controller.averageWeightKillsIsCompleted),
],
),
);
@@ -107,10 +97,7 @@ class KillingRegistrationPage extends GetView<KillingRegistrationLogic> {
],
);
} else {
return Text(
'${item.unitName} (${item.address?.city?.name})',
maxLines: 2,
);
return Text('${item.unitName} (${item.address?.city?.name})', maxLines: 2);
}
}
@@ -236,7 +223,7 @@ class KillingRegistrationPage extends GetView<KillingRegistrationLogic> {
),
buildUnitRow(
title: 'جمع تلفات ثبت شده دامپزشک و مرغدار',
title: 'تلفات',
value: data.value?.losses.separatedByCommaFa,
unit: 'قطعه',
padding: EdgeInsetsGeometry.symmetric(horizontal: 4),
@@ -248,7 +235,7 @@ class KillingRegistrationPage extends GetView<KillingRegistrationLogic> {
padding: EdgeInsetsGeometry.symmetric(horizontal: 4),
),
buildUnitRow(
title: 'سن مرغ',
title: 'سن جوجه',
value: data.value?.chickenAge.separatedByCommaFa,
unit: 'روز',
padding: EdgeInsetsGeometry.symmetric(horizontal: 4),
@@ -386,6 +373,7 @@ class KillingRegistrationPage extends GetView<KillingRegistrationLogic> {
},
filledColor: Colors.white,
keyboardType: TextInputType.number,
inputFormatters: [FirstDigitDecimalFormatter()],
controller: controller.averageWeightKillsController,
),
);

View File

@@ -14,22 +14,22 @@ class PoultryActionLogic extends GetxController {
PoultryActionItem(
title: "بازرسی",
route: ChickenRoutes.inspectionPoultryScience,
icon: Assets.vec.cubeSearchSvg.path,
icon: Assets.vec.chickenInspectionSvg.path,
),
PoultryActionItem(
title: "ثبت کشتار",
route: ChickenRoutes.genocidePoultryScience,
icon: Assets.vec.noteRemoveSvg.path,
icon: Assets.vec.registerKillSvg.path,
),
PoultryActionItem(
title: "فارم ها",
route: ChickenRoutes.farmPoultryScience,
icon: Assets.vec.cubeScanSvg.path,
icon: Assets.vec.farmsSvg.path,
),
PoultryActionItem(
title: "جوجه ریزی فعال",
route: ChickenRoutes.activeHatchingPoultryScience,
icon: Assets.vec.boxTickSvg.path,
icon: Assets.vec.activeFramSvg.path,
),
].obs;
}