From 0123998e8dd80cc2b0fef6c28dc2afa284d554c9 Mon Sep 17 00:00:00 2001 From: pradeepkumar Date: Thu, 7 May 2026 15:36:53 +0530 Subject: [PATCH] fix: increase agent card height and update image cropping to prevent portrait photo truncation --- .../widgets/features_section.dart | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/lib/features/home/presentation/widgets/features_section.dart b/lib/features/home/presentation/widgets/features_section.dart index b5b4adc..14a6789 100644 --- a/lib/features/home/presentation/widgets/features_section.dart +++ b/lib/features/home/presentation/widgets/features_section.dart @@ -242,8 +242,10 @@ class _FeaturesSectionState extends ConsumerState { ), const SizedBox(height: 24), // Static agent cards carousel (same as web) + // Height = image (220) + content padding/text (~210) — covers all + // variants (with multi-line location, "+more" buttons, etc.). SizedBox( - height: 370, + height: 430, child: ListView.builder( controller: _agentScrollController, scrollDirection: Axis.horizontal, @@ -360,7 +362,8 @@ class _FeaturesSectionState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // Image + // Image — taller box + top-anchored crop so faces stay visible + // for portrait photos (heads were getting cropped off the top). ClipRRect( borderRadius: const BorderRadius.vertical(top: Radius.circular(15)), @@ -368,25 +371,32 @@ class _FeaturesSectionState extends ConsumerState { ? Image.network( agent.image, width: 254, - height: 161, + height: 220, fit: BoxFit.cover, + alignment: Alignment.topCenter, errorBuilder: (_, __, ___) => Container( width: 254, - height: 161, + height: 220, color: const Color(0xFFC4D9D4), - child: const Icon(Icons.person, size: 60, color: AppColors.primaryDark), + child: const Icon(Icons.person, + size: 60, color: AppColors.primaryDark), ), ) : Image.asset( - (agent.image.isNotEmpty ? agent.image : 'assets/images/agent-anderson.jpg').replaceFirst(RegExp(r'^/'), ''), + (agent.image.isNotEmpty + ? agent.image + : 'assets/images/agent-anderson.jpg') + .replaceFirst(RegExp(r'^/'), ''), width: 254, - height: 161, + height: 220, fit: BoxFit.cover, + alignment: Alignment.topCenter, errorBuilder: (_, __, ___) => Container( width: 254, - height: 161, + height: 220, color: const Color(0xFFC4D9D4), - child: const Icon(Icons.person, size: 60, color: AppColors.primaryDark), + child: const Icon(Icons.person, + size: 60, color: AppColors.primaryDark), ), ), ),