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

@@ -49,10 +49,10 @@ class _FeaturedProfessionalsSectionState
@override
Widget build(BuildContext context) {
final homeState = ref.watch(homeProvider);
final cmsContent = homeState.content?.topProfessionals;
final featuresContent = homeState.content?.features;
// Use CMS agents list for the featured carousel
final professionals = cmsContent?.agents ?? [];
// Use CMS featuredAgents from features section (matches web)
final professionals = featuresContent?.featuredAgents ?? [];
if (homeState.isLoading) {
return Padding(
@@ -140,7 +140,7 @@ class _FeaturedProfessionalsSectionState
);
}
Widget _buildFeaturedCard(ProfessionalItem item, int index) {
Widget _buildFeaturedCard(FeaturedAgentItem item, int index) {
return Container(
decoration: BoxDecoration(
color: Colors.white,
@@ -185,10 +185,10 @@ class _FeaturedProfessionalsSectionState
),
const SizedBox(height: 2),
// Subtitle
if (item.subtitle.isNotEmpty)
// Role
if (item.role.isNotEmpty)
Text(
item.subtitle,
item.role,
style: const TextStyle(
fontFamily: 'Fractul',
fontSize: 14,
@@ -200,7 +200,7 @@ class _FeaturedProfessionalsSectionState
),
const SizedBox(height: 6),
// Verified badge
// Verified badge + Rating
Row(
children: [
SvgPicture.asset(
@@ -223,6 +223,20 @@ class _FeaturedProfessionalsSectionState
color: Color(0xFF638559),
),
),
if (item.rating.isNotEmpty) ...[
const SizedBox(width: 8),
const Icon(Icons.star, size: 16, color: Color(0xFFFFDE21)),
const SizedBox(width: 2),
Text(
'Rating',
style: TextStyle(
fontFamily: 'SourceSerif4',
fontSize: 14,
fontWeight: FontWeight.w500,
color: AppColors.primaryDark,
),
),
],
],
),
const SizedBox(height: 6),