feat: Implement S3 image handling with a new resolver and widget, update agent display, and configure storage base URL.

This commit is contained in:
pradeepkumar
2026-03-07 22:19:17 +05:30
parent aefe80253f
commit ee08e86449
11 changed files with 238 additions and 101 deletions

View File

@@ -22,6 +22,7 @@ class AgentProfile {
final AgentType? agentType;
final AgentUser? user;
final List<AgentFieldValue> fieldValues;
final String? createdAt;
const AgentProfile({
required this.id,
@@ -45,10 +46,26 @@ class AgentProfile {
this.agentType,
this.user,
this.fieldValues = const [],
this.createdAt,
});
String get fullName => '$firstName $lastName'.trim();
/// Format "Member Since March 2024" from createdAt date string.
String get memberSinceText {
if (createdAt == null || createdAt!.isEmpty) return 'Member Since 2024';
try {
final date = DateTime.parse(createdAt!);
const months = [
'January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December',
];
return 'Member Since ${months[date.month - 1]} ${date.year}';
} catch (_) {
return 'Member Since 2024';
}
}
/// Get avatar URL — check agent avatar first, then user avatar
String? get avatarUrl => avatar ?? user?.avatar;
@@ -175,6 +192,7 @@ class AgentProfile {
?.map((e) => AgentFieldValue.fromJson(e as Map<String, dynamic>))
.toList() ??
const [],
createdAt: json['createdAt'] as String?,
);
}
}