fix : ui changes pre release

This commit is contained in:
2025-07-20 15:34:13 +03:30
parent cb264c3234
commit e27da8da69
6 changed files with 113 additions and 100 deletions

View File

@@ -38,7 +38,7 @@ class BuyInProvincePage extends GetView<BuyInProvinceLogic> {
children: [ children: [
Expanded( Expanded(
child: RSegment( child: RSegment(
children: ['در انتظار', 'همه'], children: ['در انتظار', 'بایگانی'],
selectedIndex: 0, selectedIndex: 0,
borderColor: const Color(0xFFB4B4B4), borderColor: const Color(0xFFB4B4B4),
selectedBorderColor: AppColor.blueNormal, selectedBorderColor: AppColor.blueNormal,

View File

@@ -248,9 +248,10 @@ class BuyInProvinceAllPage extends GetView<BuyInProvinceAllLogic> {
Color getLabelColor(String? item) { Color getLabelColor(String? item) {
switch (item) { switch (item) {
case 'pending': case 'pending':
return AppColor.greenLightHover;
case 'accepted':
return AppColor.blueLight; return AppColor.blueLight;
case 'accepted':
return AppColor.greenLightHover;
case 'rejected': case 'rejected':
return AppColor.redLightHover; return AppColor.redLightHover;
default: default:

View File

@@ -60,7 +60,14 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
], ],
floatingActionButton: RFab.add( floatingActionButton: RFab.add(
onPressed: () { onPressed: () {
Get.bottomSheet(addPurchasedInformationBottomSheet(), isScrollControlled: true); Get.bottomSheet(
addPurchasedInformationBottomSheet(),
isScrollControlled: true,
ignoreSafeArea: false,
).whenComplete(() {
controller.resetSubmitForm();
},);
}, },
), ),
floatingActionButtonLocation: FloatingActionButtonLocation.startFloat, floatingActionButtonLocation: FloatingActionButtonLocation.startFloat,
@@ -190,6 +197,7 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
addPurchasedInformationBottomSheet(true), addPurchasedInformationBottomSheet(true),
isScrollControlled: true, isScrollControlled: true,
).whenComplete(() { ).whenComplete(() {
controller.resetSubmitForm(); controller.resetSubmitForm();
}); });
}, },
@@ -292,87 +300,85 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
Widget addPurchasedInformationBottomSheet([bool isOnEdit = false]) { Widget addPurchasedInformationBottomSheet([bool isOnEdit = false]) {
return BaseBottomSheet( return BaseBottomSheet(
child: SingleChildScrollView( child: Form(
child: Form( key: controller.formKey,
key: controller.formKey, child: Column(
child: Column( spacing: 8,
spacing: 8, children: [
children: [ Text(
Text( isOnEdit ? 'ویرایش اطلاعات خرید' : 'ثبت اطلاعات خرید',
isOnEdit ? 'ویرایش اطلاعات خرید' : 'ثبت اطلاعات خرید', style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), ),
), _productDropDown(),
_productDropDown(),
Container( Container(
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColor.darkGreyLight, width: 1), border: Border.all(color: AppColor.darkGreyLight, width: 1),
),
child: Column(spacing: 12, children: [_provinceWidget(), _cityWidget()]),
), ),
Container( child: Column(spacing: 12, children: [_provinceWidget(), _cityWidget()]),
padding: EdgeInsets.all(8), ),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColor.darkGreyLight, width: 1),
),
child: Column( Container(
spacing: 12, padding: EdgeInsets.all(8),
children: [ decoration: BoxDecoration(
RTextField( color: Colors.white,
controller: controller.sellerNameController, borderRadius: BorderRadius.circular(8),
label: 'نام فروشنده', border: Border.all(color: AppColor.darkGreyLight, width: 1),
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), child: Column(
SizedBox(), 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(),
],
), ),
), ),
); );

View File

@@ -78,7 +78,9 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
addOrEditBottomSheet(), addOrEditBottomSheet(),
isScrollControlled: true, isScrollControlled: true,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
); ).whenComplete(() {
controller.clearForm();
});
}, },
), ),
@@ -326,7 +328,9 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
addOrEditBottomSheet(true), addOrEditBottomSheet(true),
isScrollControlled: true, isScrollControlled: true,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
); ).whenComplete(() {
controller.clearForm();
});
}, },
textStyle: AppFonts.yekan20.copyWith(color: Colors.white), textStyle: AppFonts.yekan20.copyWith(color: Colors.white),
backgroundColor: AppColor.greenNormal, backgroundColor: AppColor.greenNormal,

View File

@@ -55,7 +55,13 @@ class SegmentationPage extends GetView<SegmentationLogic> {
floatingActionButtonLocation: FloatingActionButtonLocation.startFloat, floatingActionButtonLocation: FloatingActionButtonLocation.startFloat,
floatingActionButton: RFab.add( floatingActionButton: RFab.add(
onPressed: () { onPressed: () {
Get.bottomSheet(addOrEditBottomSheet(), isScrollControlled: true); Get.bottomSheet(
addOrEditBottomSheet(),
isScrollControlled: true,
ignoreSafeArea: false,
).whenComplete(() {
controller.clearForm();
});
}, },
), ),
); );
@@ -189,6 +195,7 @@ class SegmentationPage extends GetView<SegmentationLogic> {
Get.bottomSheet( Get.bottomSheet(
addOrEditBottomSheet(true), addOrEditBottomSheet(true),
isScrollControlled: true, isScrollControlled: true,
ignoreSafeArea: false,
).whenComplete(() { ).whenComplete(() {
controller.clearForm(); controller.clearForm();
}); });
@@ -221,7 +228,7 @@ class SegmentationPage extends GetView<SegmentationLogic> {
Widget addOrEditBottomSheet([bool isOnEdit = false]) { Widget addOrEditBottomSheet([bool isOnEdit = false]) {
return BaseBottomSheet( return BaseBottomSheet(
height: 300.h, height: 340.h,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Form( child: Form(
key: controller.formKey, key: controller.formKey,

View File

@@ -11,21 +11,18 @@ class BaseBottomSheet extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return SafeArea(
height: height ?? MediaQuery.of(context).size.height * 0.85, child: Container(
padding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), height: height ?? MediaQuery.of(context).size.height * 0.80,
decoration: BoxDecoration( padding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
color: bgColor ?? Colors.white, decoration: BoxDecoration(
borderRadius: BorderRadius.only( color: bgColor ?? Colors.white,
topLeft: Radius.circular(25), borderRadius: BorderRadius.only(
topRight: Radius.circular(25), topLeft: Radius.circular(25),
topRight: Radius.circular(25),
),
), ),
),
child: SingleChildScrollView(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
spacing: 8,
children: [ children: [
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
@@ -54,10 +51,8 @@ class BaseBottomSheet extends StatelessWidget {
], ],
), ),
), ),
SizedBox(height: 2), SizedBox(height: 2),
Expanded(child: SingleChildScrollView(child: child)),
child,
], ],
), ),
), ),