feat: implement FeaturedAgentItem model and update UI to sync with web CMS, and add form reset functionality to agent edit screen

This commit is contained in:
pradeepkumar
2026-03-30 15:12:09 +05:30
parent b3905865d6
commit 857983821d
3 changed files with 75 additions and 9 deletions

View File

@@ -126,15 +126,46 @@ class HeroContent {
// --- Features Section ---
class FeaturedAgentItem {
final String name;
final String role;
final String rating;
final String location;
final String experience;
final String imageUrl;
const FeaturedAgentItem({
this.name = '',
this.role = '',
this.rating = '',
this.location = '',
this.experience = '',
this.imageUrl = '',
});
factory FeaturedAgentItem.fromJson(Map<String, dynamic> json) {
return FeaturedAgentItem(
name: json['name'] as String? ?? '',
role: json['role'] as String? ?? '',
rating: json['rating'] as String? ?? '',
location: json['location'] as String? ?? '',
experience: json['experience'] as String? ?? '',
imageUrl: json['imageUrl'] as String? ?? '',
);
}
}
class FeaturesContent {
final String title;
final String subtitle;
final List<FeatureItem> features;
final List<FeaturedAgentItem> featuredAgents;
const FeaturesContent({
this.title = '',
this.subtitle = '',
this.features = const [],
this.featuredAgents = const [],
});
factory FeaturesContent.fromJson(Map<String, dynamic> json) {
@@ -146,6 +177,11 @@ class FeaturesContent {
(e) => FeatureItem.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
featuredAgents: (json['featuredAgents'] as List<dynamic>?)
?.map(
(e) => FeaturedAgentItem.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
);
}
}