feat: redirect agents to profile on login, update UI layouts, and add analytics dependencies.

This commit is contained in:
pradeepkumar
2026-05-06 13:19:31 +05:30
parent c6b96e19dc
commit 8845e77274
10 changed files with 293 additions and 175 deletions

View File

@@ -23,6 +23,7 @@ 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';
@@ -288,8 +289,8 @@ final routerProvider = Provider<GoRouter>((ref) {
);
});
/// Always shows the user HomeScreen for /home. Agents reach their own
/// dashboard via the Edit Profile tab in the Profile section.
/// Reactively switches between HomeScreen and AgentHomeScreen based on auth.
/// Agents see their dashboard (profile view); users see the discovery home.
class _HomeRouteWrapper extends ConsumerWidget {
const _HomeRouteWrapper();
@@ -306,8 +307,10 @@ class _HomeRouteWrapper extends ConsumerWidget {
);
}
// Home icon always shows the User Home Page regardless of role.
// Agents access their own dashboard via the Edit Profile tab in /profile.
if (authState.status == AuthStatus.authenticated &&
authState.user?.role == 'AGENT') {
return const AgentHomeScreen();
}
return const HomeScreen();
}
}