diff --git a/lib/presentation/routes/app_pages.dart b/lib/presentation/routes/app_pages.dart index f3ec1d8..ffc9cca 100644 --- a/lib/presentation/routes/app_pages.dart +++ b/lib/presentation/routes/app_pages.dart @@ -18,8 +18,8 @@ part 'app_paths.dart'; sealed class AppPages { AppPages._(); - //static const String initRoutes = AppPaths.splash; - static const String initRoutes = AppPaths.test; + static const String initRoutes = AppPaths.splash; + // static const String initRoutes = AppPaths.test; static const String initDesignSystem = AppPaths.systemDesignPage; static List pages = [ diff --git a/packages/chicken/lib/presentation/pages/poultry_science/genocide/view.dart b/packages/chicken/lib/presentation/pages/poultry_science/genocide/view.dart index 8efc68a..3b89fe7 100644 --- a/packages/chicken/lib/presentation/pages/poultry_science/genocide/view.dart +++ b/packages/chicken/lib/presentation/pages/poultry_science/genocide/view.dart @@ -74,6 +74,7 @@ class GenocidePage extends GetView { secondChild: itemListExpandedWidget(item), labelColor: AppColor.blueLight, labelIcon: Assets.vec.timerSvg.path, + labelIconColor: AppColor.yellowNormal2, ); }, controller.expandedIndex); }, diff --git a/packages/chicken/lib/presentation/pages/poultry_science/home/view.dart b/packages/chicken/lib/presentation/pages/poultry_science/home/view.dart index 25576fc..9b77cf7 100644 --- a/packages/chicken/lib/presentation/pages/poultry_science/home/view.dart +++ b/packages/chicken/lib/presentation/pages/poultry_science/home/view.dart @@ -21,7 +21,7 @@ class PoultryScienceHomePage extends GetView { child: Column( children: [ - SizedBox(height: 8.h), + SizedBox(height: 18.h), InkWell( onTap: () { controller.isExpanded.value = !controller.isExpanded.value; diff --git a/packages/chicken/lib/presentation/pages/poultry_science/inspection/view.dart b/packages/chicken/lib/presentation/pages/poultry_science/inspection/view.dart index f465138..e20d239 100644 --- a/packages/chicken/lib/presentation/pages/poultry_science/inspection/view.dart +++ b/packages/chicken/lib/presentation/pages/poultry_science/inspection/view.dart @@ -57,6 +57,9 @@ class InspectionPoultrySciencePage extends GetView { secondChild: itemListExpandedWidget(item), labelColor: getLabelColor(item.receiverState), labelIcon: controller.getVecPathItem(item.receiverState), + labelIconColor: controller.getLabelColor(item.receiverState), ); }, controller.isExpandedListIndex); }, @@ -87,9 +88,10 @@ class BuyInProvinceAllPage extends GetView { ), ), Text( - '${item.weightOfCarcasses?.separatedByCommaFa}kg', + item.weightOfCarcasses?.separatedByCommaFa.addKg ?? 'N/A', textAlign: TextAlign.left, - style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), + textDirection: TextDirection.ltr, + style: AppFonts.yekan12Bold.copyWith(color: AppColor.blueNormal), ), ], ), @@ -195,15 +197,21 @@ class BuyInProvinceAllPage extends GetView { buildRow(title: 'محصول', value: item.product?.name ?? 'N/A'), buildRow( title: 'وزن خریداری شده', - value: '${item.weightOfCarcasses?.separatedByCommaFa} کیلوگرم', + value: item.weightOfCarcasses?.separatedByCommaFa ?? 'N/A', + valueLabel: 'کیلوگرم', ), buildRow( title: 'قیمت هر کیلوگرم', - titleLabel:(item.approvedPriceStatus ?? false) ? 'مصوب' : 'آزاد' , - titleLabelStyle: AppFonts.yekan14Bold.copyWith(color: AppColor.greenNormal), - value: '${item.amount?.separatedByCommaFa} ریال', + titleLabel: (item.approvedPriceStatus ?? false) ? 'مصوب' : 'آزاد', + titleLabelStyle: AppFonts.yekan14Bold.copyWith(color: AppColor.greenNormal), + value: item.amount?.separatedByCommaFa ?? 'N/A', + valueLabel: 'ریال', + ), + buildRow( + title: 'قیمت کل', + value: item.totalAmount?.separatedByCommaFa ?? 'N/A', + valueLabel: 'ریال', ), - buildRow(title: 'قیمت کل', value: '${item.totalAmount?.separatedByCommaFa} ریال'), Visibility( visible: item.receiverState == 'pending', @@ -222,7 +230,6 @@ class BuyInProvinceAllPage extends GetView { conformationBottomSheet(item), isScrollControlled: true, ).then((value) { - Get.back(); controller.clearApprovedController(); }); diff --git a/packages/chicken/lib/presentation/pages/steward/buy_in_province_waiting/view.dart b/packages/chicken/lib/presentation/pages/steward/buy_in_province_waiting/view.dart index 515c6eb..4c2d1e3 100644 --- a/packages/chicken/lib/presentation/pages/steward/buy_in_province_waiting/view.dart +++ b/packages/chicken/lib/presentation/pages/steward/buy_in_province_waiting/view.dart @@ -32,6 +32,7 @@ class BuyInProvinceWaitingPage extends GetView { secondChild: itemListExpandedWidget(item), labelColor: AppColor.blueLight, labelIcon: Assets.vec.timerSvg.path, + labelIconColor: AppColor.yellowNormal2, ); }, controller.isExpandedListIndex); }, @@ -90,9 +91,10 @@ class BuyInProvinceWaitingPage extends GetView { ), ), Text( - '${item.weightOfCarcasses?.separatedByCommaFa}kg', + item.weightOfCarcasses?.separatedByCommaFa.addKg ?? 'N/A', textAlign: TextAlign.left, - style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), + textDirection: TextDirection.ltr, + style: AppFonts.yekan12Bold.copyWith(color: AppColor.blueNormal), ), ], ), diff --git a/packages/chicken/lib/presentation/pages/steward/home/view.dart b/packages/chicken/lib/presentation/pages/steward/home/view.dart index 9d2117b..0e0527c 100644 --- a/packages/chicken/lib/presentation/pages/steward/home/view.dart +++ b/packages/chicken/lib/presentation/pages/steward/home/view.dart @@ -19,13 +19,14 @@ class HomePage extends GetView { isBase: true, onRefresh: controller.refreshData, child: SingleChildScrollView( + padding: EdgeInsets.only(bottom: 100.h), child: Column( children: [ SizedBox(height: 18.h), mainInformation(), SizedBox(height: 8.h), WidelyUsedWidget(), - SizedBox(height: 20), + ], ), ), diff --git a/packages/chicken/lib/presentation/pages/steward/sales_in_province/view.dart b/packages/chicken/lib/presentation/pages/steward/sales_in_province/view.dart index 736b3d7..37f9701 100644 --- a/packages/chicken/lib/presentation/pages/steward/sales_in_province/view.dart +++ b/packages/chicken/lib/presentation/pages/steward/sales_in_province/view.dart @@ -189,9 +189,10 @@ class SalesInProvincePage extends GetView { ), ), Text( - '${item.weightOfCarcasses?.separatedByCommaFa}kg', + item.weightOfCarcasses!.separatedByCommaFa.addKg, textAlign: TextAlign.left, - style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), + textDirection: TextDirection.ltr, + style: AppFonts.yekan12Bold.copyWith(color: AppColor.blueNormal), ), ], ), diff --git a/packages/chicken/lib/presentation/pages/steward/sales_out_of_province/view.dart b/packages/chicken/lib/presentation/pages/steward/sales_out_of_province/view.dart index 75bcba2..53511f9 100644 --- a/packages/chicken/lib/presentation/pages/steward/sales_out_of_province/view.dart +++ b/packages/chicken/lib/presentation/pages/steward/sales_out_of_province/view.dart @@ -6,6 +6,7 @@ import 'package:rasadyar_chicken/data/models/response/roles_products/roles_produ import 'package:rasadyar_chicken/data/models/response/steward_free_sale_bar/steward_free_sale_bar.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/string_utils.dart'; import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart'; import 'package:rasadyar_chicken/presentation/widget/filter_bottom_sheet.dart'; import 'package:rasadyar_chicken/presentation/widget/steward/inventory_widget.dart'; @@ -140,11 +141,11 @@ class SalesOutOfProvincePage extends GetView { ), Text( - '${item.weightOfCarcasses?.separatedByCommaFa ?? 0}KG', + item.weightOfCarcasses!.separatedByCommaFa.addKg, textAlign: TextAlign.center, + textDirection: TextDirection.ltr, style: AppFonts.yekan12Bold.copyWith(color: AppColor.textColor), ), - ], ), ), @@ -176,22 +177,19 @@ class SalesOutOfProvincePage extends GetView { mainAxisAlignment: MainAxisAlignment.center, spacing: 8, children: [ - - Text( - item.buyer?.province?? 'N/A', + item.buyer?.province ?? 'N/A', textAlign: TextAlign.center, style: AppFonts.yekan12.copyWith(color: AppColor.bgDark), ), Text( - item.buyer?.city?? 'N/A', + item.buyer?.city ?? 'N/A', textAlign: TextAlign.center, style: AppFonts.yekan12.copyWith(color: AppColor.bgDark), ), ], ), ), - ], ); } @@ -257,12 +255,30 @@ class SalesOutOfProvincePage extends GetView { buildRow(title: 'تلفن خریدار', value: item.buyer?.mobile ?? 'N/A'), buildRow(title: 'نام واحد', value: item.buyer?.unitName ?? 'N/A'), buildRow( - title: 'وزن لاشه (کیلوگرم)', + title: 'وزن لاشه ', value: '${item.weightOfCarcasses?.separatedByCommaFa}', + valueLabel: 'کیلوگرم' ), buildRow( - title: 'حجم تقریبی لاشه (قطعه)', + title: 'حجم تقریبی لاشه ', value: '${item.numberOfCarcasses?.separatedByCommaFa}', + valueLabel: 'قطعه' + + ), + buildRow( + title: 'انبار فروش', + value: '${item.quota?.faTitle}', + ), + buildRow( + title: 'کد قرنطینه ', + value: item.clearanceCode?? 'بدون کد', + ), + + buildRow( + title: 'حجم تقریبی لاشه ', + value: '${item.numberOfCarcasses?.separatedByCommaFa}', + valueLabel: 'قطعه' + ), Row( diff --git a/packages/chicken/lib/presentation/pages/steward/sales_out_of_province_buyers/view.dart b/packages/chicken/lib/presentation/pages/steward/sales_out_of_province_buyers/view.dart index 4b509f1..61c3de0 100644 --- a/packages/chicken/lib/presentation/pages/steward/sales_out_of_province_buyers/view.dart +++ b/packages/chicken/lib/presentation/pages/steward/sales_out_of_province_buyers/view.dart @@ -53,7 +53,7 @@ class SalesOutOfProvinceBuyersPage extends GetView controller.toggleExpansion(), + onTap: () => controller.toggleExpansion(index: index), index: index, child: itemListWidget(item), secondChild: itemListExpandedWidget(item), @@ -304,7 +304,16 @@ class SalesOutOfProvinceBuyersPage extends GetView { Expanded( flex: 2, child: Text( - '${item.weight.separatedByCommaFa} KG', + item.weight.separatedByCommaFa.addKg, textAlign: TextAlign.center, - style: AppFonts.yekan12.copyWith(color: AppColor.bgDark), + textDirection: TextDirection.ltr, + style: AppFonts.yekan14Bold.copyWith(color: AppColor.blueNormal), ), ), ], @@ -207,7 +208,10 @@ class SegmentationPage extends GetView { : item.buyer?.shop ?? 'N/A', ), buildRow(title: 'ماهیت', value: item.toGuild != null ? 'مباشر' : 'قطعه‌بند'), - buildRow(title: 'وزن قطعه‌بندی', value: '${item.weight?.separatedByCommaFa}'), + buildRow(title: 'وزن قطعه‌بندی', + value: item.weight!.separatedByCommaFa, + valueLabel: 'کیلوگرم' + ), Row( mainAxisAlignment: MainAxisAlignment.center, diff --git a/packages/core/lib/presentation/common/app_color.dart b/packages/core/lib/presentation/common/app_color.dart index 7a29a07..1a4e92c 100644 --- a/packages/core/lib/presentation/common/app_color.dart +++ b/packages/core/lib/presentation/common/app_color.dart @@ -128,12 +128,15 @@ class AppColor { static const Color yellowLightHover = Color(0xFFfff6da); // #fff6da rgb(255, 246, 218) static const Color yellowLightActive = Color(0xFFffecb2); // #ffecb2 rgb(255, 236, 178) static const Color yellowNormal = Color(0xFFffc107); // #ffc107 rgb(255, 193, 7) + static const Color yellowNormal2 = Color(0xFFFF9800); // #FF9800 rgb(255, 152, 0) static const Color yellowNormalHover = Color(0xFFe6ae06); // #e6ae06 rgb(230, 174, 6) static const Color yellowNormalActive = Color(0xFFcc9a06); // #cc9a06 rgb(204, 154, 6) static const Color yellowDark = Color(0xFFbf9105); // #bf9105 rgb(191, 145, 5) static const Color yellowDarkHover = Color(0xFF997404); // #997404 rgb(153, 116, 4) static const Color yellowDarkActive = Color(0xFF735703); // #735703 rgb(115, 87, 3) static const Color yellowDarker = Color(0xFF594402); // #594402 rgb(89, 68, 2) + + // #594402 rgb(89, 68, 2) //endregion //region --- red Colors --- diff --git a/packages/core/lib/presentation/widget/base_page/widgets/r_app_bar.dart b/packages/core/lib/presentation/widget/base_page/widgets/r_app_bar.dart index 4065ad2..3d024d4 100644 --- a/packages/core/lib/presentation/widget/base_page/widgets/r_app_bar.dart +++ b/packages/core/lib/presentation/widget/base_page/widgets/r_app_bar.dart @@ -85,6 +85,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget { if (hasNotification) SizedBox(width: 8.w), if (!isBase) ...{ + SizedBox(width: 8.w), if (hasFilter) GestureDetector( onTap: onFilterTap, @@ -95,7 +96,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget { ), ), if (hasBack) SizedBox(width: 8.w), - + if (hasSearch) SizedBox(width: 8.w), if (hasSearch) GestureDetector( onTap: onSearchTap, child: Assets.vec.searchSvg.svg( diff --git a/packages/core/lib/utils/extension/string_utils.dart b/packages/core/lib/utils/extension/string_utils.dart index a464443..2de8cea 100644 --- a/packages/core/lib/utils/extension/string_utils.dart +++ b/packages/core/lib/utils/extension/string_utils.dart @@ -1,15 +1,15 @@ import 'package:intl/intl.dart'; import 'package:persian_datetime_picker/persian_datetime_picker.dart'; -extension XString on String { +extension XString on String? { String get separatedByComma { final formatter = NumberFormat('#,###'); - final number = num.tryParse(this); - return number != null ? formatter.format(number) : this; + final number = num.tryParse(this ?? ''); + return number != null ? formatter.format(number) : (this ?? ''); } String get clearComma { - return replaceAll(RegExp(r'\D'), ''); + return (this ?? '').replaceAll(RegExp(r'\D'), ''); } String get addCountEXT { @@ -20,21 +20,29 @@ extension XString on String { return '$thisروزه'; } - String get addKgEXT { - return '$this کیلوگرم'; + String get addKgFa { + return '${this ?? 0}کیلوگرم '; } - DateTime get toDateTime => DateTime.parse(this); + String get addKgFaWithParentheses { + return '${this ?? 0} (کیلوگرم)'; + } + + String get addKg { + return '$this KG'; + } + + DateTime get toDateTime => DateTime.parse(this ?? ''); String get formattedJalaliDate { - String tmp = contains("/") ? replaceAll("/", "-") : this; + String tmp = (this != null && this!.contains("/")) ? this!.replaceAll("/", "-") : (this ?? ""); final dateTime = DateTime.parse(tmp); final jalaliDate = Jalali.fromDateTime(dateTime); return "${jalaliDate.year}/${jalaliDate.month.toString().padLeft(2, '0')}/${jalaliDate.day.toString().padLeft(2, '0')}"; } String get formattedJalaliDateYHMS { - final dateTime = DateTime.parse(this); + final dateTime = DateTime.parse(this ?? ''); final jalaliDate = Jalali.fromDateTime(dateTime); return "${jalaliDate.hour.toString().padLeft(2, '0')}:${jalaliDate.minute.toString().padLeft(2, '0')} - ${jalaliDate.year}/${jalaliDate.month.toString().padLeft(2, '0')}/${jalaliDate.day.toString().padLeft(2, '0')}"; } @@ -44,9 +52,9 @@ extension XString on String { } Jalali get toJalali { - final dateTime = DateTime.parse(this); + final dateTime = DateTime.parse(this ?? ''); return Jalali.fromDateTime(dateTime); } - int get versionNumber => int.parse(replaceAll(".", '')); + int get versionNumber => int.parse(this?.replaceAll(".", '') ?? '0'); } diff --git a/packages/inspection/lib/presentation/pages/inspection_map/widget/map/view.dart b/packages/inspection/lib/presentation/pages/inspection_map/widget/map/view.dart index 5095798..d2e773c 100644 --- a/packages/inspection/lib/presentation/pages/inspection_map/widget/map/view.dart +++ b/packages/inspection/lib/presentation/pages/inspection_map/widget/map/view.dart @@ -558,12 +558,12 @@ class MapPage extends GetView { buildRow( title: 'میانگین وزن کشتار', - value: hatchingDetails?.totalAverageKilledWeight.toString().addKgEXT ?? 'N/A', + value: hatchingDetails?.totalAverageKilledWeight.toString().addKgFa ?? 'N/A', ), buildRow( title: 'وزن کشتار', - value: hatchingDetails?.totalKilledWeight.separatedByCommaFa.addKgEXT ?? 'N/A', + value: hatchingDetails?.totalKilledWeight.separatedByCommaFa.addKgFa ?? 'N/A', ), ], );