From 4780eb9a637e15104659fc5787841fef6058d505 Mon Sep 17 00:00:00 2001 From: pradeepkumar Date: Tue, 10 Mar 2026 23:15:11 +0530 Subject: [PATCH] refactor: Consolidate agent name display into a single `Text.rich` widget and adjust verified icon padding. --- .../screens/agent_home_screen.dart | 43 ++++++------------- 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/lib/features/agents/presentation/screens/agent_home_screen.dart b/lib/features/agents/presentation/screens/agent_home_screen.dart index 8834b66..d75f7d2 100644 --- a/lib/features/agents/presentation/screens/agent_home_screen.dart +++ b/lib/features/agents/presentation/screens/agent_home_screen.dart @@ -527,46 +527,29 @@ class _AgentHomeContentState extends ConsumerState<_AgentHomeContent> { crossAxisAlignment: CrossAxisAlignment.center, children: [ Flexible( - child: Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.baseline, - textBaseline: TextBaseline.alphabetic, - children: [ - Flexible( - child: Text( - '${agent.firstName} ', + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: '${agent.firstName} ${agent.lastName}', style: const TextStyle( fontFamily: 'Fractul', fontSize: 18, fontWeight: FontWeight.w700, color: AppColors.primaryDark, ), - overflow: TextOverflow.ellipsis, ), - ), - if (agent.isVerified) - const Padding( - padding: EdgeInsets.only(right: 4), - child: Icon(Icons.verified, - size: 16, color: Color(0xFF2196F3)), - ), - Flexible( - child: Text( - agent.lastName, - style: const TextStyle( - fontFamily: 'Fractul', - fontSize: 18, - fontWeight: FontWeight.w400, - color: AppColors.primaryDark, - ), - overflow: TextOverflow.ellipsis, - ), - ), - ], + ], + ), + overflow: TextOverflow.ellipsis, ), ), if (agent.isVerified) ...[ - const SizedBox(width: 6), + const Padding( + padding: EdgeInsets.only(left: 6, right: 4), + child: Icon(Icons.verified, + size: 16, color: Color(0xFF2196F3)), + ), const Text( '(Verified Expert)', style: TextStyle(