6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 8fbdefee
Changed files
.../authentication/authentication_repository.dart | 3 ++- .../lib/common/components/comwell_app_bar.dart | 2 +- .../cubit/hotel_information_cubit.dart | 1 + .../lib/notifications/notifications_page.dart | 2 +- comwell_key_app/lib/overview/overview_route.dart | 27 ---------------------- .../change_password/change_password_modal.dart | 22 ++++++++++++++++++ .../change_password/change_password_route.dart | 10 ++++++++ comwell_key_app/lib/profile/profile_route.dart | 10 ++++++++ .../components/change_password_modal.dart | 22 ------------------ .../profile_settings/profile_settings_route.dart | 10 ++++++++ comwell_key_app/lib/routing/app_router.dart | 6 +++++ 11 files changed, 63 insertions(+), 52 deletions(-)
Diff
diff --git a/comwell_key_app/lib/authentication/authentication_repository.dart b/comwell_key_app/lib/authentication/authentication_repository.dart
index 49324776..3cc2bdc0 100644
--- a/comwell_key_app/lib/authentication/authentication_repository.dart
+++ b/comwell_key_app/lib/authentication/authentication_repository.dart
@@ -30,7 +30,8 @@ class AuthenticationRepository {
try {
await _msalService.acquireTokenSilent();
return true;
- } catch (_) {
+ } catch (e) {
+ print("qqq login error=$e");
return false;
}
}
diff --git a/comwell_key_app/lib/common/components/comwell_app_bar.dart b/comwell_key_app/lib/common/components/comwell_app_bar.dart
index 1603f16c..045e22ff 100644
--- a/comwell_key_app/lib/common/components/comwell_app_bar.dart
+++ b/comwell_key_app/lib/common/components/comwell_app_bar.dart
@@ -70,7 +70,7 @@ class ComwellAppBar extends StatelessWidget implements PreferredSizeWidget {
color: Colors.white,
icon: "assets/icons/user-open.svg",
onPressed: () {
- context.go(AppRoutes.profile);
+ context.push(AppRoutes.profile);
},
),
),
diff --git a/comwell_key_app/lib/hotel_information/cubit/hotel_information_cubit.dart b/comwell_key_app/lib/hotel_information/cubit/hotel_information_cubit.dart
index cc8e3845..78c0f111 100644
--- a/comwell_key_app/lib/hotel_information/cubit/hotel_information_cubit.dart
+++ b/comwell_key_app/lib/hotel_information/cubit/hotel_information_cubit.dart
@@ -16,6 +16,7 @@ class HotelInformationCubit extends Cubit<HotelInformationState> {
HotelInformationCubit({required this.hotelInformationRepository, required this.booking})
: super(const HotelInformationState.initial()) {
+ print("qqq HotelInformationCubit");
init();
}
diff --git a/comwell_key_app/lib/notifications/notifications_page.dart b/comwell_key_app/lib/notifications/notifications_page.dart
index 5b5e7a99..75bfb670 100644
--- a/comwell_key_app/lib/notifications/notifications_page.dart
+++ b/comwell_key_app/lib/notifications/notifications_page.dart
@@ -19,7 +19,7 @@ class NotificationsPage extends StatelessWidget {
final cubit = context.read<NotificationsCubit>();
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.surface,
- appBar: const ComwellAppBar(),
+ appBar: const ComwellAppBar(shouldShowProfileButton: false),
body: BlocBuilder<NotificationsCubit, NotificationsState>(
builder: (context, state) {
if (state.isLoading) {
diff --git a/comwell_key_app/lib/overview/overview_route.dart b/comwell_key_app/lib/overview/overview_route.dart
index bd29450f..9f0e7451 100644
--- a/comwell_key_app/lib/overview/overview_route.dart
+++ b/comwell_key_app/lib/overview/overview_route.dart
@@ -1,9 +1,6 @@
import 'package:comwell_key_app/connection_state/connection_state_listener.dart';
import 'package:go_router/go_router.dart';
-import '../profile/profile_page.dart';
-import '../profile_settings/components/change_password_modal.dart';
-import '../profile_settings/profile_settings_page.dart';
import '../routing/app_routes.dart';
import 'overview_page.dart';
@@ -16,28 +13,4 @@ RouteBase overviewRoute = GoRoute(
),
);
},
- routes: [
- GoRoute(
- path: "profile",
- builder: (context, state) {
- return const ProfilePage();
- },
- routes: [
- GoRoute(
- path: "profile_settings",
- builder: (context, state) {
- return const ProfileSettingsPage();
- },
- routes: [
- GoRoute(
- path: 'change_password',
- builder: (context, state) {
- return const ChangePasswordModal();
- },
- ),
- ],
- ),
- ],
- ),
- ],
);
diff --git a/comwell_key_app/lib/presentation/screens/change_password/change_password_modal.dart b/comwell_key_app/lib/presentation/screens/change_password/change_password_modal.dart
new file mode 100644
index 00000000..e88800a1
--- /dev/null
+++ b/comwell_key_app/lib/presentation/screens/change_password/change_password_modal.dart
@@ -0,0 +1,22 @@
+import 'package:comwell_key_app/common/components/bottom_sheet_widget.dart';
+
+import 'package:flutter/material.dart';
+
+class ChangePasswordModal extends StatefulWidget {
+ const ChangePasswordModal({super.key});
+
+ @override
+ ChangePasswordModalState createState() => ChangePasswordModalState();
+}
+
+class ChangePasswordModalState extends State<ChangePasswordModal> {
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: AppBar(
+ title: const Text('Change Password'),
+ ),
+ body: const BottomSheetWidget(widgetChildren: [Text("data")],)
+ );
+ }
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/presentation/screens/change_password/change_password_route.dart b/comwell_key_app/lib/presentation/screens/change_password/change_password_route.dart
new file mode 100644
index 00000000..cab439a6
--- /dev/null
+++ b/comwell_key_app/lib/presentation/screens/change_password/change_password_route.dart
@@ -0,0 +1,10 @@
+import 'package:comwell_key_app/presentation/screens/change_password/change_password_modal.dart';
+import 'package:comwell_key_app/routing/app_routes.dart';
+import 'package:go_router/go_router.dart';
+
+final changePasswordRoute = GoRoute(
+ path: AppRoutes.changePassword,
+ builder: (context, state) {
+ return const ChangePasswordModal();
+ },
+);
diff --git a/comwell_key_app/lib/profile/profile_route.dart b/comwell_key_app/lib/profile/profile_route.dart
new file mode 100644
index 00000000..eab94e9e
--- /dev/null
+++ b/comwell_key_app/lib/profile/profile_route.dart
@@ -0,0 +1,10 @@
+import 'package:comwell_key_app/profile/profile_page.dart';
+import 'package:comwell_key_app/routing/app_routes.dart';
+import 'package:go_router/go_router.dart';
+
+final profileRoute = GoRoute(
+ path: AppRoutes.profile,
+ builder: (context, state) {
+ return const ProfilePage();
+ },
+);
diff --git a/comwell_key_app/lib/profile_settings/components/change_password_modal.dart b/comwell_key_app/lib/profile_settings/components/change_password_modal.dart
deleted file mode 100644
index e88800a1..00000000
--- a/comwell_key_app/lib/profile_settings/components/change_password_modal.dart
+++ /dev/null
@@ -1,22 +0,0 @@
-import 'package:comwell_key_app/common/components/bottom_sheet_widget.dart';
-
-import 'package:flutter/material.dart';
-
-class ChangePasswordModal extends StatefulWidget {
- const ChangePasswordModal({super.key});
-
- @override
- ChangePasswordModalState createState() => ChangePasswordModalState();
-}
-
-class ChangePasswordModalState extends State<ChangePasswordModal> {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: const Text('Change Password'),
- ),
- body: const BottomSheetWidget(widgetChildren: [Text("data")],)
- );
- }
-}
\ No newline at end of file
diff --git a/comwell_key_app/lib/profile_settings/profile_settings_route.dart b/comwell_key_app/lib/profile_settings/profile_settings_route.dart
new file mode 100644
index 00000000..34f64bfd
--- /dev/null
+++ b/comwell_key_app/lib/profile_settings/profile_settings_route.dart
@@ -0,0 +1,10 @@
+import 'package:comwell_key_app/profile_settings/profile_settings_page.dart';
+import 'package:comwell_key_app/routing/app_routes.dart';
+import 'package:go_router/go_router.dart';
+
+final profileSettingsRoute = GoRoute(
+ path: AppRoutes.profileSettings,
+ builder: (context, state) {
+ return const ProfileSettingsPage();
+ },
+);
diff --git a/comwell_key_app/lib/routing/app_router.dart b/comwell_key_app/lib/routing/app_router.dart
index b6690331..325c8008 100644
--- a/comwell_key_app/lib/routing/app_router.dart
+++ b/comwell_key_app/lib/routing/app_router.dart
@@ -6,6 +6,7 @@ import 'package:comwell_key_app/housekeeping/house_keeping_route.dart';
import 'package:comwell_key_app/my_booking/my_booking_route.dart';
import 'package:comwell_key_app/notifications/notifications_route.dart';
import 'package:comwell_key_app/pregistration/preregistration_route.dart';
+import 'package:comwell_key_app/presentation/screens/change_password/change_password_route.dart';
import 'package:comwell_key_app/presentation/screens/payment_processing/payment_processing_route.dart';
import 'package:comwell_key_app/presentation/screens/room_info/room_info_route.dart';
import 'package:comwell_key_app/contact/contact_route.dart';
@@ -16,6 +17,8 @@ import 'package:comwell_key_app/login/login_route.dart';
import 'package:comwell_key_app/overview/overview_route.dart';
import 'package:comwell_key_app/presentation/screens/past_cancelled_booking_details/past_cancelled_booking_detail_route.dart';
import 'package:comwell_key_app/presentation/screens/webview/webview_route.dart';
+import 'package:comwell_key_app/profile/profile_route.dart';
+import 'package:comwell_key_app/profile_settings/profile_settings_route.dart';
import 'package:comwell_key_app/received_shared_booking/received_shared_booking_route.dart';
import 'package:comwell_key_app/received_shared_room/received_shared_room_route.dart';
import 'package:comwell_key_app/routing/app_routes.dart';
@@ -83,6 +86,9 @@ final router = GoRouter(
notificationsPermissionRoute,
usageTrackingPermissionRoute,
overviewRoute,
+ profileRoute,
+ profileSettingsRoute,
+ changePasswordRoute,
webviewRoute,
pastCancelledBookingDetailsRoute,
bookingDetailsRoute,