feat: update Find Agents button navigation to redirect agents to home screen

This commit is contained in:
pradeepkumar
2026-03-30 19:20:54 +05:30
parent 446e591cfa
commit 8ee77420af
2 changed files with 31 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ import 'package:go_router/go_router.dart';
import 'package:real_estate_mobile/core/constants/app_colors.dart';
import 'package:real_estate_mobile/core/network/api_client.dart';
import 'package:real_estate_mobile/core/widgets/s3_image.dart';
import 'package:real_estate_mobile/features/auth/presentation/providers/auth_provider.dart';
// ── Data models (matching web CMS types) ──
@@ -825,9 +826,18 @@ class AboutScreen extends ConsumerWidget {
),
),
const SizedBox(height: 24),
// Find Agents Now button
GestureDetector(
onTap: () => context.push('/agents/search'),
// Find Agents Now button — navigate based on user role
Consumer(builder: (context, ref, _) {
return GestureDetector(
onTap: () {
final authState = ref.read(authProvider);
if (authState.status == AuthStatus.authenticated &&
authState.user?.role == 'AGENT') {
context.go('/home');
} else {
context.push('/agents/search');
}
},
child: Container(
height: 50,
width: 210,
@@ -846,7 +856,8 @@ class AboutScreen extends ConsumerWidget {
),
),
),
),
);
}),
const SizedBox(height: 12),
// Get Help button
GestureDetector(