diff --git a/assets/icons/back_circle_icon.svg b/assets/icons/back_circle_icon.svg
new file mode 100644
index 0000000..452ca2d
--- /dev/null
+++ b/assets/icons/back_circle_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/lib/features/agents/presentation/screens/agent_edit_profile_screen.dart b/lib/features/agents/presentation/screens/agent_edit_profile_screen.dart
index 6229aff..620e5f7 100644
--- a/lib/features/agents/presentation/screens/agent_edit_profile_screen.dart
+++ b/lib/features/agents/presentation/screens/agent_edit_profile_screen.dart
@@ -1,10 +1,13 @@
import 'dart:convert';
+import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
+import 'package:image_picker/image_picker.dart';
import 'package:intl/intl.dart';
+import 'package:flutter_svg/flutter_svg.dart';
import 'package:real_estate_mobile/core/constants/app_colors.dart';
import 'package:real_estate_mobile/features/profile/data/profile_repository.dart';
@@ -13,15 +16,17 @@ import 'package:real_estate_mobile/features/profile/data/profile_repository.dart
// ---------------------------------------------------------------------------
/// Bundles all three API calls needed to render the edit-profile form.
-final _editProfileDataProvider =
- FutureProvider.autoDispose<_EditProfileData>((ref) async {
+final _editProfileDataProvider = FutureProvider.autoDispose<_EditProfileData>((
+ ref,
+) async {
final repo = ProfileRepository();
// 1. Fetch agent profile (need agentTypeId + pre-fill values)
final profile = await repo.getMyProfile('AGENT');
// 2. Resolve agentTypeId
- final agentTypeId = profile['agentTypeId'] as String? ??
+ final agentTypeId =
+ profile['agentTypeId'] as String? ??
(profile['agentType'] as Map?)?['id'] as String?;
if (agentTypeId == null || agentTypeId.isEmpty) {
throw Exception('Agent type not found on profile');
@@ -153,9 +158,11 @@ class _AgentEditProfileScreenState
final existingEntries = fvMap[entriesKey];
if (existingEntries is List && existingEntries.isNotEmpty) {
_repeatableEntries[sectionSlug] = existingEntries
- .map((e) => e is Map
- ? Map.from(e)
- : {})
+ .map(
+ (e) => e is Map
+ ? Map.from(e)
+ : {},
+ )
.toList();
} else {
_repeatableEntries[sectionSlug] = [{}];
@@ -193,7 +200,10 @@ class _AgentEditProfileScreenState
}
dynamic _normalizeValue(
- dynamic value, String fieldType, Map field) {
+ dynamic value,
+ String fieldType,
+ Map field,
+ ) {
switch (fieldType) {
case 'CHECKBOX':
if (value is bool) return value;
@@ -228,6 +238,16 @@ class _AgentEditProfileScreenState
final min = (rangeConfig?['min'] as num?)?.toDouble() ?? 0;
final max = (rangeConfig?['max'] as num?)?.toDouble() ?? 100;
return {'min': min, 'max': max};
+ case 'FILE_UPLOAD':
+ // Keep as list of maps — don't stringify
+ if (value is List) return value;
+ if (value is String && value.isNotEmpty) {
+ try {
+ final decoded = jsonDecode(value);
+ if (decoded is List) return decoded;
+ } catch (_) {}
+ }
+ return