From a45c0807d1eaf53afbd3a73cf1ea7a616a9f3868 Mon Sep 17 00:00:00 2001 From: "mr.mojtaba" Date: Tue, 22 Apr 2025 15:08:01 +0330 Subject: [PATCH] fix : some ui bug --- android/app/src/main/AndroidManifest.xml | 1 + .../presentation/display_information/view.dart | 2 +- .../supervision/lib/presentation/filter/view.dart | 2 +- .../lib/presentation/profile/view.dart | 13 ++++++------- .../draggable_bottom_sheet_controller.dart | 15 ++++++++------- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 94398a7..1e152ab 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -11,6 +11,7 @@ android:exported="true" android:launchMode="singleTop" android:taskAffinity="" + android:enableOnBackInvokedCallback="true" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" diff --git a/features/supervision/lib/presentation/display_information/view.dart b/features/supervision/lib/presentation/display_information/view.dart index 9b4ddca..a48da49 100644 --- a/features/supervision/lib/presentation/display_information/view.dart +++ b/features/supervision/lib/presentation/display_information/view.dart @@ -78,7 +78,7 @@ class DisplayInformationPage extends GetView { Expanded(child: ROutlinedElevated( height: 40, text: 'انصراف', onPressed: (){ - Get.offAllNamed(SupervisionRoutes.supervision); + Get.until((route) => route.isFirst); })) ], ) diff --git a/features/supervision/lib/presentation/filter/view.dart b/features/supervision/lib/presentation/filter/view.dart index 49ca869..77f8e7f 100644 --- a/features/supervision/lib/presentation/filter/view.dart +++ b/features/supervision/lib/presentation/filter/view.dart @@ -23,7 +23,7 @@ class SupervisionFilterPage extends GetView { @override Widget build(BuildContext context) { return PopScope( - canPop: controller.sheetController.value.handleBack(), + canPop: controller.sheetController.value.handleBack, onPopInvokedWithResult: (didPop, result) { if (!didPop && controller.sheetController.value.bottomSheets.isNotEmpty) { diff --git a/features/supervision/lib/presentation/profile/view.dart b/features/supervision/lib/presentation/profile/view.dart index 7c2b49e..d0f417b 100644 --- a/features/supervision/lib/presentation/profile/view.dart +++ b/features/supervision/lib/presentation/profile/view.dart @@ -43,7 +43,6 @@ class ProfilePage extends GetView { Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, - spacing: 16, children: [ SizedBox( @@ -77,12 +76,12 @@ class ProfilePage extends GetView { itemCount: controller.roles.length, ), ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 30, - vertical: 10, - ), - child: Expanded( + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 30, + vertical: 10, + ), child: ObxValue((data) { return switch (data.value) { 0 => userProfileInformation(), diff --git a/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet_controller.dart b/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet_controller.dart index 8c57cdf..ac393f5 100644 --- a/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet_controller.dart +++ b/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet_controller.dart @@ -116,12 +116,13 @@ class DraggableBottomSheetController extends GetxController { }); } } - - bool handleBack() { - if (bottomSheets.isNotEmpty) { - removeLastBottomSheet(); - return true; - } - return false; + bool get handleBack{ + if (bottomSheets.isNotEmpty) { + removeLastBottomSheet(); + return true; } + return false; + } + } +