fix: invalidate agent cache on profile update and add expandable list support for expertise and certifications

This commit is contained in:
pradeepkumar
2026-04-15 19:02:49 +05:30
parent 2424743226
commit 3a86758561
2 changed files with 102 additions and 43 deletions

View File

@@ -8,6 +8,8 @@ import 'package:go_router/go_router.dart';
import 'package:image_picker/image_picker.dart';
import 'package:intl/intl.dart';
import 'package:real_estate_mobile/core/constants/app_colors.dart';
import 'package:real_estate_mobile/features/agents/presentation/providers/agent_detail_provider.dart';
import 'package:real_estate_mobile/features/auth/presentation/providers/auth_provider.dart';
import 'package:real_estate_mobile/features/profile/data/profile_repository.dart';
// ---------------------------------------------------------------------------
@@ -385,6 +387,14 @@ class _AgentEditProfileScreenState
}
}
// Invalidate the agent detail provider so the dashboard refetches
// field values after save (was showing stale cached data).
final userId = ref.read(authProvider).user?.id;
if (userId != null) {
ref.invalidate(agentDetailProvider(userId));
}
ref.invalidate(_editProfileDataProvider);
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(