From e27da8da69a34f0787e792161e5a60c7ee4ba227 Mon Sep 17 00:00:00 2001 From: "mr.mojtaba" Date: Sun, 20 Jul 2025 15:34:13 +0330 Subject: [PATCH] fix : ui changes pre release --- .../pages/buy_in_province/view.dart | 2 +- .../pages/buy_in_province_all/view.dart | 5 +- .../pages/buy_out_of_province/view.dart | 160 +++++++++--------- .../pages/sales_in_province/view.dart | 8 +- .../presentation/pages/segmentation/view.dart | 11 +- .../bottom_sheet/base_bottom_sheet.dart | 27 ++- 6 files changed, 113 insertions(+), 100 deletions(-) diff --git a/packages/chicken/lib/presentation/pages/buy_in_province/view.dart b/packages/chicken/lib/presentation/pages/buy_in_province/view.dart index 17ad848..6343fd4 100644 --- a/packages/chicken/lib/presentation/pages/buy_in_province/view.dart +++ b/packages/chicken/lib/presentation/pages/buy_in_province/view.dart @@ -38,7 +38,7 @@ class BuyInProvincePage extends GetView { children: [ Expanded( child: RSegment( - children: ['در انتظار', 'همه'], + children: ['در انتظار', 'بایگانی'], selectedIndex: 0, borderColor: const Color(0xFFB4B4B4), selectedBorderColor: AppColor.blueNormal, diff --git a/packages/chicken/lib/presentation/pages/buy_in_province_all/view.dart b/packages/chicken/lib/presentation/pages/buy_in_province_all/view.dart index e6929b2..3ddd066 100644 --- a/packages/chicken/lib/presentation/pages/buy_in_province_all/view.dart +++ b/packages/chicken/lib/presentation/pages/buy_in_province_all/view.dart @@ -248,9 +248,10 @@ class BuyInProvinceAllPage extends GetView { Color getLabelColor(String? item) { switch (item) { case 'pending': - return AppColor.greenLightHover; - case 'accepted': return AppColor.blueLight; + case 'accepted': + + return AppColor.greenLightHover; case 'rejected': return AppColor.redLightHover; default: diff --git a/packages/chicken/lib/presentation/pages/buy_out_of_province/view.dart b/packages/chicken/lib/presentation/pages/buy_out_of_province/view.dart index 165b129..7b85d9b 100644 --- a/packages/chicken/lib/presentation/pages/buy_out_of_province/view.dart +++ b/packages/chicken/lib/presentation/pages/buy_out_of_province/view.dart @@ -60,7 +60,14 @@ class BuyOutOfProvincePage extends GetView { ], floatingActionButton: RFab.add( onPressed: () { - Get.bottomSheet(addPurchasedInformationBottomSheet(), isScrollControlled: true); + Get.bottomSheet( + addPurchasedInformationBottomSheet(), + isScrollControlled: true, + ignoreSafeArea: false, + ).whenComplete(() { + controller.resetSubmitForm(); + + },); }, ), floatingActionButtonLocation: FloatingActionButtonLocation.startFloat, @@ -190,6 +197,7 @@ class BuyOutOfProvincePage extends GetView { addPurchasedInformationBottomSheet(true), isScrollControlled: true, ).whenComplete(() { + controller.resetSubmitForm(); }); }, @@ -292,87 +300,85 @@ class BuyOutOfProvincePage extends GetView { Widget addPurchasedInformationBottomSheet([bool isOnEdit = false]) { return BaseBottomSheet( - child: SingleChildScrollView( - child: Form( - key: controller.formKey, - child: Column( - spacing: 8, - children: [ - Text( - isOnEdit ? 'ویرایش اطلاعات خرید' : 'ثبت اطلاعات خرید', - style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), - ), - _productDropDown(), + child: Form( + key: controller.formKey, + child: Column( + spacing: 8, + children: [ + Text( + isOnEdit ? 'ویرایش اطلاعات خرید' : 'ثبت اطلاعات خرید', + style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), + ), + _productDropDown(), - Container( - padding: EdgeInsets.all(8), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: AppColor.darkGreyLight, width: 1), - ), - - child: Column(spacing: 12, children: [_provinceWidget(), _cityWidget()]), + Container( + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), ), - Container( - padding: EdgeInsets.all(8), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: AppColor.darkGreyLight, width: 1), - ), + child: Column(spacing: 12, children: [_provinceWidget(), _cityWidget()]), + ), - child: Column( - spacing: 12, - children: [ - RTextField( - controller: controller.sellerNameController, - label: 'نام فروشنده', - borderColor: AppColor.darkGreyLight, - filled: true, - filledColor: AppColor.bgLight, - ), - RTextField( - controller: controller.sellerPhoneController, - label: 'تلفن فروشنده', - keyboardType: TextInputType.phone, - borderColor: AppColor.darkGreyLight, - maxLength: 11, - filled: true, - filledColor: AppColor.bgLight, - validator: (value) { - if (value == null || value.isEmpty) { - return 'لطفاً شماره موبایل را وارد کنید'; - } - String cleaned = value.replaceAll(',', ''); - if (cleaned.length != 11) { - return 'شماره موبایل باید ۱۱ رقم باشد'; - } - if (!cleaned.startsWith('09')) { - return 'شماره موبایل باید با 09 شروع شود'; - } - return null; - }, - ), - - UnitTextField( - controller: controller.carcassWeightController, - hint: 'وزن', - unit: 'کیلوگرم', - inputFormatters: [ - FilteringTextInputFormatter.digitsOnly, - SeparatorInputFormatter(), - ], - ), - ], - ), + Container( + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.darkGreyLight, width: 1), ), - _imageCarcasesWidget(isOnEdit), - submitButtonWidget(isOnEdit), - SizedBox(), - ], - ), + + child: Column( + spacing: 12, + children: [ + RTextField( + controller: controller.sellerNameController, + label: 'نام فروشنده', + borderColor: AppColor.darkGreyLight, + filled: true, + filledColor: AppColor.bgLight, + ), + RTextField( + controller: controller.sellerPhoneController, + label: 'تلفن فروشنده', + keyboardType: TextInputType.phone, + borderColor: AppColor.darkGreyLight, + maxLength: 11, + filled: true, + filledColor: AppColor.bgLight, + validator: (value) { + if (value == null || value.isEmpty) { + return 'لطفاً شماره موبایل را وارد کنید'; + } + String cleaned = value.replaceAll(',', ''); + if (cleaned.length != 11) { + return 'شماره موبایل باید ۱۱ رقم باشد'; + } + if (!cleaned.startsWith('09')) { + return 'شماره موبایل باید با 09 شروع شود'; + } + return null; + }, + ), + + UnitTextField( + controller: controller.carcassWeightController, + hint: 'وزن', + unit: 'کیلوگرم', + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + SeparatorInputFormatter(), + ], + ), + ], + ), + ), + _imageCarcasesWidget(isOnEdit), + submitButtonWidget(isOnEdit), + SizedBox(), + ], ), ), ); diff --git a/packages/chicken/lib/presentation/pages/sales_in_province/view.dart b/packages/chicken/lib/presentation/pages/sales_in_province/view.dart index 7171ab7..c3e30c5 100644 --- a/packages/chicken/lib/presentation/pages/sales_in_province/view.dart +++ b/packages/chicken/lib/presentation/pages/sales_in_province/view.dart @@ -78,7 +78,9 @@ class SalesInProvincePage extends GetView { addOrEditBottomSheet(), isScrollControlled: true, backgroundColor: Colors.transparent, - ); + ).whenComplete(() { + controller.clearForm(); + }); }, ), @@ -326,7 +328,9 @@ class SalesInProvincePage extends GetView { addOrEditBottomSheet(true), isScrollControlled: true, backgroundColor: Colors.transparent, - ); + ).whenComplete(() { + controller.clearForm(); + }); }, textStyle: AppFonts.yekan20.copyWith(color: Colors.white), backgroundColor: AppColor.greenNormal, diff --git a/packages/chicken/lib/presentation/pages/segmentation/view.dart b/packages/chicken/lib/presentation/pages/segmentation/view.dart index efbe797..080ad23 100644 --- a/packages/chicken/lib/presentation/pages/segmentation/view.dart +++ b/packages/chicken/lib/presentation/pages/segmentation/view.dart @@ -55,7 +55,13 @@ class SegmentationPage extends GetView { floatingActionButtonLocation: FloatingActionButtonLocation.startFloat, floatingActionButton: RFab.add( onPressed: () { - Get.bottomSheet(addOrEditBottomSheet(), isScrollControlled: true); + Get.bottomSheet( + addOrEditBottomSheet(), + isScrollControlled: true, + ignoreSafeArea: false, + ).whenComplete(() { + controller.clearForm(); + }); }, ), ); @@ -189,6 +195,7 @@ class SegmentationPage extends GetView { Get.bottomSheet( addOrEditBottomSheet(true), isScrollControlled: true, + ignoreSafeArea: false, ).whenComplete(() { controller.clearForm(); }); @@ -221,7 +228,7 @@ class SegmentationPage extends GetView { Widget addOrEditBottomSheet([bool isOnEdit = false]) { return BaseBottomSheet( - height: 300.h, + height: 340.h, child: SingleChildScrollView( child: Form( key: controller.formKey, diff --git a/packages/core/lib/presentation/widget/bottom_sheet/base_bottom_sheet.dart b/packages/core/lib/presentation/widget/bottom_sheet/base_bottom_sheet.dart index 71cbaff..7d921b7 100644 --- a/packages/core/lib/presentation/widget/bottom_sheet/base_bottom_sheet.dart +++ b/packages/core/lib/presentation/widget/bottom_sheet/base_bottom_sheet.dart @@ -11,21 +11,18 @@ class BaseBottomSheet extends StatelessWidget { @override Widget build(BuildContext context) { - return Container( - height: height ?? MediaQuery.of(context).size.height * 0.85, - padding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), - decoration: BoxDecoration( - color: bgColor ?? Colors.white, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(25), - topRight: Radius.circular(25), + return SafeArea( + child: Container( + height: height ?? MediaQuery.of(context).size.height * 0.80, + padding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), + decoration: BoxDecoration( + color: bgColor ?? Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(25), + topRight: Radius.circular(25), + ), ), - ), - child: SingleChildScrollView( child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, - spacing: 8, children: [ SizedBox( width: MediaQuery.of(context).size.width, @@ -54,10 +51,8 @@ class BaseBottomSheet extends StatelessWidget { ], ), ), - SizedBox(height: 2), - - child, + Expanded(child: SingleChildScrollView(child: child)), ], ), ),