diff --git a/lib/features/profile/presentation/screens/profile_settings_screen.dart b/lib/features/profile/presentation/screens/profile_settings_screen.dart index 119d9bf..c9fbe9c 100644 --- a/lib/features/profile/presentation/screens/profile_settings_screen.dart +++ b/lib/features/profile/presentation/screens/profile_settings_screen.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:real_estate_mobile/core/constants/app_colors.dart'; -import 'package:real_estate_mobile/features/agents/presentation/screens/agent_edit_profile_screen.dart'; +import 'package:real_estate_mobile/features/agents/presentation/screens/agent_home_screen.dart'; import 'package:real_estate_mobile/features/profile/presentation/providers/profile_provider.dart'; import 'package:real_estate_mobile/features/profile/presentation/widgets/profile_settings_tab.dart'; import 'package:real_estate_mobile/features/profile/presentation/widgets/change_password_tab.dart'; @@ -90,7 +90,7 @@ class _ProfileSettingsScreenState extends ConsumerState { final label = tabs[selectedTab].label; switch (label) { case 'Edit Profile': - return const AgentEditProfileScreen(embedded: true); + return const AgentHomeScreen(); case 'Profile Settings': return const ProfileSettingsTab(); case 'Change Password': diff --git a/lib/routing/app_router.dart b/lib/routing/app_router.dart index c0a9c2f..da4212f 100644 --- a/lib/routing/app_router.dart +++ b/lib/routing/app_router.dart @@ -14,7 +14,6 @@ import 'package:real_estate_mobile/features/faq/presentation/screens/faq_screen. import 'package:real_estate_mobile/features/home/presentation/screens/home_screen.dart'; import 'package:real_estate_mobile/features/messaging/presentation/screens/conversations_screen.dart'; import 'package:real_estate_mobile/features/messaging/presentation/screens/chat_screen.dart'; -import 'package:real_estate_mobile/features/agents/presentation/screens/agent_home_screen.dart'; import 'package:real_estate_mobile/features/contact/presentation/screens/contact_screen.dart'; import 'package:real_estate_mobile/features/about/presentation/screens/about_screen.dart'; import 'package:real_estate_mobile/features/agents/presentation/screens/agent_network_screen.dart'; @@ -289,9 +288,8 @@ final routerProvider = Provider((ref) { ); }); -/// Reactively switches between HomeScreen and AgentHomeScreen based on auth. -/// Shows a loading indicator while auth status is being determined to prevent -/// flashing the wrong screen on refresh. +/// Always shows the user HomeScreen for /home. Agents reach their own +/// dashboard via the Edit Profile tab in the Profile section. class _HomeRouteWrapper extends ConsumerWidget { const _HomeRouteWrapper(); @@ -308,10 +306,8 @@ class _HomeRouteWrapper extends ConsumerWidget { ); } - if (authState.status == AuthStatus.authenticated && - authState.user?.role == 'AGENT') { - return const AgentHomeScreen(); - } + // Home icon always shows the User Home Page regardless of role. + // Agents access their own dashboard via the Edit Profile tab in /profile. return const HomeScreen(); } }