From 0f4a3abfa2d548d0a1c0eaa410a9b5b7bac9ae26 Mon Sep 17 00:00:00 2001 From: pradeepkumar Date: Tue, 17 Mar 2026 10:59:47 +0530 Subject: [PATCH] feat: Add a back button to the agent search screen and adjust the search bar's left padding. --- .../screens/agent_detail_screen.dart | 32 ++++++++++++++++++- .../screens/agent_search_screen.dart | 13 +++++++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/lib/features/agents/presentation/screens/agent_detail_screen.dart b/lib/features/agents/presentation/screens/agent_detail_screen.dart index 7a2075b..2ab8127 100644 --- a/lib/features/agents/presentation/screens/agent_detail_screen.dart +++ b/lib/features/agents/presentation/screens/agent_detail_screen.dart @@ -102,8 +102,38 @@ class _AgentDetailScreenState extends ConsumerState { physics: const AlwaysScrollableScrollPhysics(), child: Column( children: [ + // ── Back Button ── + Padding( + padding: const EdgeInsets.fromLTRB(16, 8, 16, 0), + child: Align( + alignment: Alignment.centerLeft, + child: GestureDetector( + onTap: () { + if (Navigator.of(context).canPop()) { + Navigator.of(context).pop(); + } else { + context.go('/home'); + } + }, + child: Container( + width: 36, + height: 36, + decoration: BoxDecoration( + color: AppColors.primaryDark.withValues(alpha: 0.08), + shape: BoxShape.circle, + ), + child: const Icon( + Icons.arrow_back_ios_new_rounded, + color: AppColors.primaryDark, + size: 18, + ), + ), + ), + ), + ), + // ── Avatar Section ── - const SizedBox(height: 16), + const SizedBox(height: 8), _buildAvatarSection(agent), // ── Status + Connect Buttons ── diff --git a/lib/features/agents/presentation/screens/agent_search_screen.dart b/lib/features/agents/presentation/screens/agent_search_screen.dart index d175f17..c8c19f5 100644 --- a/lib/features/agents/presentation/screens/agent_search_screen.dart +++ b/lib/features/agents/presentation/screens/agent_search_screen.dart @@ -116,11 +116,22 @@ class _AgentSearchScreenState extends ConsumerState { Widget _buildSearchBar() { return Padding( - padding: const EdgeInsets.fromLTRB(24, 16, 24, 0), + padding: const EdgeInsets.fromLTRB(16, 16, 24, 0), child: SizedBox( height: 42, child: Row( children: [ + GestureDetector( + onTap: () => context.go('/home'), + child: const Padding( + padding: EdgeInsets.only(right: 8), + child: Icon( + Icons.arrow_back_ios_new_rounded, + color: AppColors.primaryDark, + size: 20, + ), + ), + ), Expanded( child: Container( decoration: BoxDecoration(