fix: invalidate agent cache on profile update and add expandable list support for expertise and certifications
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user