From 2424743226ec27b02f6b5d7fc4aa38191cdd0f58 Mon Sep 17 00:00:00 2001 From: pradeepkumar Date: Wed, 15 Apr 2026 18:18:02 +0530 Subject: [PATCH] feat: update _buildProfileInfo to prioritize state-derived location data over agent model location --- .../presentation/screens/agent_home_screen.dart | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/features/agents/presentation/screens/agent_home_screen.dart b/lib/features/agents/presentation/screens/agent_home_screen.dart index ac12434..1aef7e4 100644 --- a/lib/features/agents/presentation/screens/agent_home_screen.dart +++ b/lib/features/agents/presentation/screens/agent_home_screen.dart @@ -264,7 +264,7 @@ class _AgentHomeContentState extends ConsumerState<_AgentHomeContent> { const SizedBox(height: 12), _buildContactInfo(state), const SizedBox(height: 16), - _buildProfileInfo(agent), + _buildProfileInfo(agent, state), const SizedBox(height: 24), _buildExperienceSection(state), const SizedBox(height: 24), @@ -680,7 +680,12 @@ class _AgentHomeContentState extends ConsumerState<_AgentHomeContent> { } // ── Name, verified badge, title, location, member since, bio ── - Widget _buildProfileInfo(AgentProfile agent) { + Widget _buildProfileInfo(AgentProfile agent, AgentDetailState state) { + // Prefer fieldValues-derived location (state.locationParts, with uppercased + // 2-letter state codes); fall back to agent model location when empty. + final locationDisplay = state.locationParts.isNotEmpty + ? state.locationParts.join(', ') + : agent.location; return Padding( padding: const EdgeInsets.symmetric(horizontal: 24), child: Column( @@ -758,7 +763,7 @@ class _AgentHomeContentState extends ConsumerState<_AgentHomeContent> { Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - if (agent.location.isNotEmpty) ...[ + if (locationDisplay.isNotEmpty) ...[ SvgPicture.asset( 'assets/icons/location_filled_icon.svg', width: 16, @@ -766,7 +771,7 @@ class _AgentHomeContentState extends ConsumerState<_AgentHomeContent> { ), const SizedBox(width: 4), Text( - agent.location, + locationDisplay, style: const TextStyle( fontFamily: 'SourceSerif4', fontSize: 14,