fix : ui fix after release 1.3.3
This commit is contained in:
@@ -44,7 +44,7 @@ class BuyInProvinceWaitingPage extends GetView<BuyInProvinceWaitingLogic> {
|
||||
);
|
||||
}, controller.waitingProduct),
|
||||
),
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
|
||||
/* floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
|
||||
floatingActionButton: ObxValue((data) {
|
||||
if ((data.value.data?.results?.length ?? 0) > 1) {
|
||||
return AnimatedFab(
|
||||
@@ -58,7 +58,7 @@ class BuyInProvinceWaitingPage extends GetView<BuyInProvinceWaitingLogic> {
|
||||
} else {
|
||||
return SizedBox.shrink();
|
||||
}
|
||||
}, controller.waitingProduct),
|
||||
}, controller.waitingProduct),*/
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ class BuyOutOfProvinceLogic extends GetxController {
|
||||
RxList<int> isExpandedList = <int>[].obs;
|
||||
final RxInt currentPage = 1.obs;
|
||||
final RxBool isLoadingMoreAllocationsMade = false.obs;
|
||||
final RxBool isOnLoadingSubmitOrEdit = false.obs;
|
||||
|
||||
//TODO add this to Di
|
||||
ImagePicker imagePicker = ImagePicker();
|
||||
@@ -170,6 +171,7 @@ class BuyOutOfProvinceLogic extends GetxController {
|
||||
|
||||
Future<bool> createStewardPurchaseOutOfProvince() async {
|
||||
bool res = false;
|
||||
isOnLoadingSubmitOrEdit.value = true;
|
||||
if (!(formKey.currentState?.validate() ?? false)) {
|
||||
return res;
|
||||
}
|
||||
@@ -196,6 +198,7 @@ class BuyOutOfProvinceLogic extends GetxController {
|
||||
res = true;
|
||||
},
|
||||
);
|
||||
isOnLoadingSubmitOrEdit.value = false;
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -205,7 +208,6 @@ class BuyOutOfProvinceLogic extends GetxController {
|
||||
carcassWeightController.clear();
|
||||
selectedProvince.value = null;
|
||||
selectedCity.value = null;
|
||||
selectedProduct.value = null;
|
||||
selectedImage.value = null;
|
||||
_base64Image.value = null;
|
||||
editImageUrl.value = null;
|
||||
|
||||
@@ -379,12 +379,13 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
||||
}
|
||||
|
||||
Widget submitButtonWidget(bool isOnEdit) {
|
||||
return ObxValue((data) {
|
||||
return Obx(() {
|
||||
return RElevated(
|
||||
text: isOnEdit ? 'ویرایش' : 'ثبت',
|
||||
width: Get.width,
|
||||
backgroundColor: AppColor.greenNormal,
|
||||
onPressed: data.value
|
||||
isLoading: controller.isOnLoadingSubmitOrEdit.value,
|
||||
onPressed: controller.isSubmitButtonEnabled.value
|
||||
? () async {
|
||||
var res = await controller.createStewardPurchaseOutOfProvince();
|
||||
if (res) {
|
||||
@@ -394,7 +395,7 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
||||
: null,
|
||||
height: 40,
|
||||
);
|
||||
}, controller.isSubmitButtonEnabled);
|
||||
});
|
||||
}
|
||||
|
||||
Widget _productDropDown() {
|
||||
|
||||
@@ -57,59 +57,32 @@ class ProfilePage extends GetView<ProfileLogic> {
|
||||
),
|
||||
),
|
||||
|
||||
ObxValue((data) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Wrap(
|
||||
spacing: 20,
|
||||
runSpacing: 10,
|
||||
children: [
|
||||
cardActionWidget(
|
||||
title: 'اطلاعات کاربری',
|
||||
onPressed: () {
|
||||
data.value = 0;
|
||||
},
|
||||
icon: Assets.vec.profileUserSvg.path,
|
||||
selected: data.value == 0,
|
||||
),
|
||||
Center(
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
spacing: 20,
|
||||
runSpacing: 10,
|
||||
children: [
|
||||
cardActionWidget(
|
||||
title: 'تغییر رمز عبور',
|
||||
selected: true,
|
||||
onPressed: () {
|
||||
Get.bottomSheet(changePasswordBottomSheet(), isScrollControlled: true);
|
||||
},
|
||||
icon: Assets.vec.lockSvg.path,
|
||||
),
|
||||
cardActionWidget(
|
||||
title: 'خروج',
|
||||
selected: true,
|
||||
onPressed: () {
|
||||
Get.bottomSheet(exitBottomSheet(), isScrollControlled: true);
|
||||
},
|
||||
icon: Assets.vec.logoutSvg.path,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
cardActionWidget(
|
||||
title: 'تغییر رمز عبور',
|
||||
selected: true,
|
||||
onPressed: () {
|
||||
Get.bottomSheet(changePasswordBottomSheet(), isScrollControlled: true);
|
||||
},
|
||||
icon: Assets.vec.lockSvg.path,
|
||||
),
|
||||
|
||||
cardActionWidget(
|
||||
title: 'خروج',
|
||||
selected: true,
|
||||
onPressed: () {
|
||||
Get.bottomSheet(exitBottomSheet(), isScrollControlled: true);
|
||||
},
|
||||
icon: Assets.vec.logoutSvg.path,
|
||||
),
|
||||
/*cardActionWidget(
|
||||
title: 'اطلاعات بانکی',
|
||||
onPressed: () {
|
||||
data.value = 1;
|
||||
},
|
||||
icon: Assets.vec.informationSvg.path,
|
||||
selected: data.value == 1,
|
||||
),
|
||||
cardActionWidget(
|
||||
title: 'اطلاعات \nصدور فاکتور',
|
||||
onPressed: () {
|
||||
data.value = 2;
|
||||
},
|
||||
icon: Assets.vec.receiptDiscountSvg.path,
|
||||
selected: data.value == 2,
|
||||
),*/
|
||||
],
|
||||
),
|
||||
);
|
||||
}, controller.selectedInformationType),
|
||||
|
||||
SizedBox(height: 100),
|
||||
],
|
||||
|
||||
@@ -49,10 +49,11 @@ class RootLogic extends GetxController {
|
||||
super.onInit();
|
||||
localDatasource = diChicken.get<ChickenLocalDataSourceImp>();
|
||||
chickenRepository = diChicken.get<ChickenRepositoryImp>();
|
||||
localDatasource.openBox().then((value) async {
|
||||
widelyUsedList.value = localDatasource.getAllWidely();
|
||||
});
|
||||
|
||||
widelyUsedList.value = localDatasource.getAllWidely();
|
||||
|
||||
//getKillHouseDistributionInfo();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -70,9 +71,7 @@ class RootLogic extends GetxController {
|
||||
}
|
||||
|
||||
if (widelyUsedList.value?.hasInit != true) {
|
||||
localDatasource.initWidleyUsed().then(
|
||||
(value) => localDatasource.getAllWidely(),
|
||||
);
|
||||
localDatasource.initWidleyUsed().then((value) => localDatasource.getAllWidely());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -86,13 +86,20 @@ class RootPage extends GetView<RootLogic> {
|
||||
label: 'خرید',
|
||||
icon: Assets.vec.buySvg.path,
|
||||
isSelected: controller.currentPage.value == 0,
|
||||
onTap: () => controller.changePage(0),
|
||||
onTap: () {
|
||||
Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst);
|
||||
|
||||
controller.changePage(0);
|
||||
},
|
||||
),
|
||||
RBottomNavigationItem(
|
||||
label: 'فروش',
|
||||
icon: Assets.vec.saleSvg.path,
|
||||
isSelected: controller.currentPage.value == 1,
|
||||
onTap: () => controller.changePage(1),
|
||||
onTap: () {
|
||||
Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst);
|
||||
controller.changePage(1);
|
||||
},
|
||||
),
|
||||
RBottomNavigationItem(
|
||||
label: 'خانه',
|
||||
|
||||
@@ -3,7 +3,6 @@ import 'package:flutter/services.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/presentation/routes/routes.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/inventory_widget.dart';
|
||||
@@ -743,7 +742,7 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
|
||||
Widget show2StepAddBottomSheet() {
|
||||
return BaseBottomSheet(
|
||||
height: Get.height * .35,
|
||||
height: Get.height * .39,
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
@@ -808,7 +807,9 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
text: ' بازگشت',
|
||||
textStyle: AppFonts.yekan18.copyWith(color: AppColor.error),
|
||||
onPressed: () {
|
||||
Get.until((route) => route.settings.name == ChickenRoutes.salesInProvince);
|
||||
Get
|
||||
..back()
|
||||
..back();
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province_buyers/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province_sales_list/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/filter_bottom_sheet.dart';
|
||||
@@ -21,14 +20,8 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
|
||||
filteringWidget: filterBottomSheet(),
|
||||
widgets: [
|
||||
inventoryWidget(controller.rootLogic),
|
||||
segmentWidget(),
|
||||
Expanded(
|
||||
child: ObxValue((index) {
|
||||
return index.value == 0
|
||||
? SalesOutOfProvinceSalesListPage()
|
||||
: SalesOutOfProvinceBuyersPage();
|
||||
}, controller.selectedSegmentIndex),
|
||||
),
|
||||
|
||||
Expanded(child: SalesOutOfProvinceSalesListPage()),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -61,5 +54,4 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
|
||||
onChangedToDate: (jalali) => controller.toDateFilter.value = jalali,
|
||||
onSubmit: () => controller.submitFilter(),
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
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/widget/list_item/list_item.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/list_row_item.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
@@ -44,10 +46,23 @@ class SalesOutOfProvinceSalesListPage extends GetView<SalesOutOfProvinceSalesLis
|
||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||
);
|
||||
}, controller.salesList),
|
||||
floatingActionButton: RFab.add(
|
||||
onPressed: () {
|
||||
Get.bottomSheet(addOrEditSaleBottomSheet(), isScrollControlled: true);
|
||||
},
|
||||
floatingActionButton: Row(
|
||||
children: [
|
||||
RFab.add(
|
||||
onPressed: () {
|
||||
Get.bottomSheet(addOrEditSaleBottomSheet(), isScrollControlled: true);
|
||||
},
|
||||
),
|
||||
Spacer(),
|
||||
RFab(
|
||||
icon: Icon(CupertinoIcons.person_add_solid, color: Colors.white, size: 35.w),
|
||||
backgroundColor: AppColor.blueNormal,
|
||||
onPressed: () {
|
||||
Get.toNamed(ChickenRoutes.salesOutOfProvinceBuyer, id: 1);
|
||||
},
|
||||
),
|
||||
SizedBox(width: 25),
|
||||
],
|
||||
),
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.startFloat,
|
||||
);
|
||||
|
||||
@@ -77,17 +77,15 @@ class SegmentationLogic extends GetxController {
|
||||
void clearForm() {
|
||||
weightController.text = '0';
|
||||
selectedSegment.value = null;
|
||||
|
||||
}
|
||||
|
||||
void validateForm() {
|
||||
isSubmitButtonEnabled = RxBool(
|
||||
var weight = int.tryParse(weightController.text.clearComma.trim());
|
||||
isSubmitButtonEnabled.value =
|
||||
selectedProduct.value != null &&
|
||||
selectedSegment.value != null &&
|
||||
weightController.text.isNotEmpty &&
|
||||
int.tryParse(weightController.text) != null &&
|
||||
int.tryParse(weightController.text)! > 0,
|
||||
);
|
||||
weight! > 0
|
||||
;
|
||||
}
|
||||
|
||||
Future<void> getAllSegmentation([bool isLoadingMore = false]) async {
|
||||
|
||||
Reference in New Issue
Block a user