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

@@ -95,10 +95,12 @@ class _Verify2faScreenState extends ConsumerState<Verify2faScreen> {
final authState = ref.watch(authProvider);
final isLoading = authState.status == AuthStatus.loading;
// Navigate to home when authentication succeeds, reset submit lock on error
// Navigate when authentication succeeds, reset submit lock on error.
// Agents land on /profile (Edit Profile tab — their home/dashboard view).
ref.listen<AuthState>(authProvider, (previous, next) {
if (next.status == AuthStatus.authenticated) {
context.go('/home');
final isAgent = next.user?.role == 'AGENT';
context.go(isAgent ? '/profile' : '/home');
}
if (next.status != AuthStatus.loading) {
_isSubmitting = false;