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:
@@ -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() ??
|
||||
[],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user