From f1b2e20056ed526e683c3a7f7b6c3cae08f34643 Mon Sep 17 00:00:00 2001 From: "mr.mojtaba" Date: Tue, 15 Jul 2025 10:31:37 +0330 Subject: [PATCH] feat : alert for all conformation fab button --- .../pages/buy_in_province_waiting/view.dart | 4 ++- .../pages/sales_in_province/view.dart | 35 +++++++++++++++++-- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/packages/chicken/lib/presentation/pages/buy_in_province_waiting/view.dart b/packages/chicken/lib/presentation/pages/buy_in_province_waiting/view.dart index 45a66ee..7310b28 100644 --- a/packages/chicken/lib/presentation/pages/buy_in_province_waiting/view.dart +++ b/packages/chicken/lib/presentation/pages/buy_in_province_waiting/view.dart @@ -48,7 +48,9 @@ class BuyInProvinceWaitingPage extends GetView { floatingActionButton: ObxValue((data) { if ((data.value.data?.results?.length ?? 0) > 1) { return AnimatedFab( - onPressed: () {}, + onPressed: () { + //TODO FAB + }, message: 'تایید یکجا', icon: Assets.vec.clipboardTaskSvg.svg(width: 45.w, height: 42.h), backgroundColor: controller.bgConfirmAllColor.value, 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 aa23d76..35e3106 100644 --- a/packages/chicken/lib/presentation/pages/sales_in_province/view.dart +++ b/packages/chicken/lib/presentation/pages/sales_in_province/view.dart @@ -55,7 +55,9 @@ class SalesInProvincePage extends GetView { secondChild: itemListExpandedWidget(item, index), labelColor: AppColor.blueLight, labelIcon: Assets.vec.timerSvg.path, - labelIconColor: item.registrationCode == null ? AppColor.darkGreyDark : AppColor.error, + labelIconColor: item.registrationCode == null + ? AppColor.darkGreyDark + : AppColor.error, ); }, controller.isExpandedList); }, @@ -86,7 +88,36 @@ class SalesInProvincePage extends GetView { visible: (data.value.data?.results?.length ?? 0) > 1, child: AnimatedFab( onPressed: () async { - await controller.confirmAllAllocations(); + Get.defaultDialog( + title: 'تایید یکجا', + middleText: 'آیا از تایید تمامی تخصیص ها اطمینان دارید؟', + confirm: ElevatedButton( + onPressed: () async { + await controller.confirmAllAllocations(); + controller.getAllocatedMade(); + controller.rootLogic.getInventory(); + Get.back(); + }, + child: Text('تایید'), + style: ElevatedButton.styleFrom( + backgroundColor: AppColor.blueNormal, + foregroundColor: Colors.white, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + ), + cancel: OutlinedButton( + style: OutlinedButton.styleFrom( + foregroundColor: AppColor.error, + enableFeedback: true, + side: BorderSide(color: AppColor.error, width: 1), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + onPressed: () { + Get.back(); + }, + child: Text('لغو'), + ), + ); }, message: 'تایید یکجا', icon: Assets.vec.clipboardTaskSvg.svg(width: 40.w, height: 40.h),