fix : some ui and
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -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([]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ sealed class ChickenPages {
|
||||
binding: BindingsBuilder(() {
|
||||
Get.lazyPut(() => GenocideLogic());
|
||||
Get.lazyPut(() => PoultryScienceRootLogic());
|
||||
Get.put( KillingRegistrationLogic());
|
||||
Get.lazyPut(() => KillingRegistrationLogic(),fenix: true);
|
||||
}),
|
||||
),
|
||||
GetPage(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: rasadyar_chicken
|
||||
description: A starting point for Dart libraries or applications.
|
||||
version: 1.2.1+2
|
||||
version: 1.3.2+3
|
||||
|
||||
environment:
|
||||
sdk: ^3.9.0
|
||||
|
||||
@@ -32,6 +32,9 @@ class $AssetsAnimGen {
|
||||
class $AssetsIconsGen {
|
||||
const $AssetsIconsGen();
|
||||
|
||||
/// File path: assets/icons/active_fram.svg
|
||||
SvgGenImage get activeFram => const SvgGenImage('assets/icons/active_fram.svg');
|
||||
|
||||
/// File path: assets/icons/add.svg
|
||||
SvgGenImage get add => const SvgGenImage('assets/icons/add.svg');
|
||||
|
||||
@@ -89,6 +92,9 @@ class $AssetsIconsGen {
|
||||
/// File path: assets/icons/chicken_house.svg
|
||||
SvgGenImage get chickenHouse => const SvgGenImage('assets/icons/chicken_house.svg');
|
||||
|
||||
/// File path: assets/icons/chicken_inspection.svg
|
||||
SvgGenImage get chickenInspection => const SvgGenImage('assets/icons/chicken_inspection.svg');
|
||||
|
||||
/// File path: assets/icons/chicken_map_marker.svg
|
||||
SvgGenImage get chickenMapMarker => const SvgGenImage('assets/icons/chicken_map_marker.svg');
|
||||
|
||||
@@ -164,6 +170,9 @@ class $AssetsIconsGen {
|
||||
/// File path: assets/icons/farm.svg
|
||||
SvgGenImage get farm => const SvgGenImage('assets/icons/farm.svg');
|
||||
|
||||
/// File path: assets/icons/farms.svg
|
||||
SvgGenImage get farms => const SvgGenImage('assets/icons/farms.svg');
|
||||
|
||||
/// File path: assets/icons/filter.svg
|
||||
SvgGenImage get filter => const SvgGenImage('assets/icons/filter.svg');
|
||||
|
||||
@@ -272,6 +281,9 @@ class $AssetsIconsGen {
|
||||
/// File path: assets/icons/receipt_discount.svg
|
||||
SvgGenImage get receiptDiscount => const SvgGenImage('assets/icons/receipt_discount.svg');
|
||||
|
||||
/// File path: assets/icons/registerKill.svg
|
||||
SvgGenImage get registerKill => const SvgGenImage('assets/icons/registerKill.svg');
|
||||
|
||||
/// File path: assets/icons/sale.svg
|
||||
SvgGenImage get sale => const SvgGenImage('assets/icons/sale.svg');
|
||||
|
||||
@@ -337,6 +349,7 @@ class $AssetsIconsGen {
|
||||
|
||||
/// List of all assets
|
||||
List<SvgGenImage> get values => [
|
||||
activeFram,
|
||||
add,
|
||||
appBarInspection,
|
||||
arrowLeft,
|
||||
@@ -356,6 +369,7 @@ class $AssetsIconsGen {
|
||||
chicken,
|
||||
chicken2,
|
||||
chickenHouse,
|
||||
chickenInspection,
|
||||
chickenMapMarker,
|
||||
chickenPattern,
|
||||
clipboardEye,
|
||||
@@ -381,6 +395,7 @@ class $AssetsIconsGen {
|
||||
empty,
|
||||
excelDownload,
|
||||
farm,
|
||||
farms,
|
||||
filter,
|
||||
filterOutline,
|
||||
gps,
|
||||
@@ -417,6 +432,7 @@ class $AssetsIconsGen {
|
||||
rasadNan,
|
||||
rasadToyor,
|
||||
receiptDiscount,
|
||||
registerKill,
|
||||
sale,
|
||||
scan,
|
||||
scanBarcode,
|
||||
@@ -500,6 +516,9 @@ class $AssetsRiveGen {
|
||||
class $AssetsVecGen {
|
||||
const $AssetsVecGen();
|
||||
|
||||
/// File path: assets/vec/active_fram.svg.vec
|
||||
SvgGenImage get activeFramSvg => const SvgGenImage.vec('assets/vec/active_fram.svg.vec');
|
||||
|
||||
/// File path: assets/vec/add.svg.vec
|
||||
SvgGenImage get addSvg => const SvgGenImage.vec('assets/vec/add.svg.vec');
|
||||
|
||||
@@ -557,6 +576,9 @@ class $AssetsVecGen {
|
||||
/// File path: assets/vec/chicken_house.svg.vec
|
||||
SvgGenImage get chickenHouseSvg => const SvgGenImage.vec('assets/vec/chicken_house.svg.vec');
|
||||
|
||||
/// File path: assets/vec/chicken_inspection.svg.vec
|
||||
SvgGenImage get chickenInspectionSvg => const SvgGenImage.vec('assets/vec/chicken_inspection.svg.vec');
|
||||
|
||||
/// File path: assets/vec/chicken_map_marker.svg.vec
|
||||
SvgGenImage get chickenMapMarkerSvg => const SvgGenImage.vec('assets/vec/chicken_map_marker.svg.vec');
|
||||
|
||||
@@ -632,6 +654,9 @@ class $AssetsVecGen {
|
||||
/// File path: assets/vec/farm.svg.vec
|
||||
SvgGenImage get farmSvg => const SvgGenImage.vec('assets/vec/farm.svg.vec');
|
||||
|
||||
/// File path: assets/vec/farms.svg.vec
|
||||
SvgGenImage get farmsSvg => const SvgGenImage.vec('assets/vec/farms.svg.vec');
|
||||
|
||||
/// File path: assets/vec/filter.svg.vec
|
||||
SvgGenImage get filterSvg => const SvgGenImage.vec('assets/vec/filter.svg.vec');
|
||||
|
||||
@@ -740,6 +765,9 @@ class $AssetsVecGen {
|
||||
/// File path: assets/vec/receipt_discount.svg.vec
|
||||
SvgGenImage get receiptDiscountSvg => const SvgGenImage.vec('assets/vec/receipt_discount.svg.vec');
|
||||
|
||||
/// File path: assets/vec/registerKill.svg.vec
|
||||
SvgGenImage get registerKillSvg => const SvgGenImage.vec('assets/vec/registerKill.svg.vec');
|
||||
|
||||
/// File path: assets/vec/sale.svg.vec
|
||||
SvgGenImage get saleSvg => const SvgGenImage.vec('assets/vec/sale.svg.vec');
|
||||
|
||||
@@ -805,6 +833,7 @@ class $AssetsVecGen {
|
||||
|
||||
/// List of all assets
|
||||
List<SvgGenImage> get values => [
|
||||
activeFramSvg,
|
||||
addSvg,
|
||||
appBarInspectionSvg,
|
||||
arrowLeftSvg,
|
||||
@@ -824,6 +853,7 @@ class $AssetsVecGen {
|
||||
chickenSvg,
|
||||
chicken2Svg,
|
||||
chickenHouseSvg,
|
||||
chickenInspectionSvg,
|
||||
chickenMapMarkerSvg,
|
||||
chickenPatternSvg,
|
||||
clipboardEyeSvg,
|
||||
@@ -849,6 +879,7 @@ class $AssetsVecGen {
|
||||
emptySvg,
|
||||
excelDownloadSvg,
|
||||
farmSvg,
|
||||
farmsSvg,
|
||||
filterSvg,
|
||||
filterOutlineSvg,
|
||||
gpsSvg,
|
||||
@@ -885,6 +916,7 @@ class $AssetsVecGen {
|
||||
rasadNanSvg,
|
||||
rasadToyorSvg,
|
||||
receiptDiscountSvg,
|
||||
registerKillSvg,
|
||||
saleSvg,
|
||||
scanSvg,
|
||||
scanBarcodeSvg,
|
||||
|
||||
24
packages/core/lib/utils/first_digit_decimal_formatter.dart
Normal file
24
packages/core/lib/utils/first_digit_decimal_formatter.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class FirstDigitDecimalFormatter extends TextInputFormatter {
|
||||
@override
|
||||
TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) {
|
||||
String digit = newValue.text.replaceAll(RegExp(r'[^0-9]'), "");
|
||||
late String res;
|
||||
|
||||
if (digit.isEmpty) {
|
||||
return newValue.copyWith(text: '');
|
||||
}
|
||||
|
||||
if (digit.length == 1) {
|
||||
res = digit;
|
||||
} else {
|
||||
res = '${digit[0]}.${digit.substring(1)}';
|
||||
}
|
||||
|
||||
return TextEditingValue(
|
||||
text: res,
|
||||
selection: TextSelection.collapsed(offset: res.length),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -14,3 +14,4 @@ export 'number_utils.dart';
|
||||
export 'parser.dart';
|
||||
export 'route_utils.dart';
|
||||
export 'separator_input_formatter.dart';
|
||||
export 'first_digit_decimal_formatter.dart';
|
||||
|
||||
@@ -953,10 +953,10 @@ packages:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: json_serializable
|
||||
sha256: "3f2913b7c2430afe8ac5afe6fb15c1de4a60af4f630625e6e238f80ba4b80cbd"
|
||||
sha256: "33a040668b31b320aafa4822b7b1e177e163fc3c1e835c6750319d4ab23aa6fe"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.11.0"
|
||||
version: "6.11.1"
|
||||
latlong2:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user