refactor: unify app navigation to default to HomeScreen and remove role-based routing redirection
This commit is contained in:
@@ -23,7 +23,6 @@ import 'package:real_estate_mobile/features/agents/presentation/screens/agent_ed
|
||||
import 'package:real_estate_mobile/features/profile/presentation/screens/payment_success_screen.dart';
|
||||
import 'package:real_estate_mobile/features/splash/presentation/screens/splash_screen.dart';
|
||||
import 'package:real_estate_mobile/features/onboarding/presentation/screens/onboarding_screen.dart';
|
||||
import 'package:real_estate_mobile/features/agents/presentation/screens/agent_home_screen.dart';
|
||||
import 'package:real_estate_mobile/features/auth/presentation/screens/verify_2fa_screen.dart';
|
||||
import 'package:real_estate_mobile/features/support_chat/presentation/screens/support_chat_screen.dart';
|
||||
import 'package:real_estate_mobile/features/coming_soon/presentation/screens/coming_soon_screen.dart';
|
||||
@@ -289,8 +288,8 @@ final routerProvider = Provider<GoRouter>((ref) {
|
||||
);
|
||||
});
|
||||
|
||||
/// Reactively switches between HomeScreen and AgentHomeScreen based on auth.
|
||||
/// Agents see their dashboard (profile view); users see the discovery home.
|
||||
/// Always shows the user HomeScreen for /home regardless of role.
|
||||
/// Agents reach their own dashboard via the Edit Profile tab in /profile.
|
||||
class _HomeRouteWrapper extends ConsumerWidget {
|
||||
const _HomeRouteWrapper();
|
||||
|
||||
@@ -307,10 +306,6 @@ class _HomeRouteWrapper extends ConsumerWidget {
|
||||
);
|
||||
}
|
||||
|
||||
if (authState.status == AuthStatus.authenticated &&
|
||||
authState.user?.role == 'AGENT') {
|
||||
return const AgentHomeScreen();
|
||||
}
|
||||
return const HomeScreen();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user