fix: increase agent card height and update image cropping to prevent portrait photo truncation

This commit is contained in:
pradeepkumar
2026-05-07 15:36:53 +05:30
parent 8a859ff56c
commit 0123998e8d

View File

@@ -242,8 +242,10 @@ class _FeaturesSectionState extends ConsumerState<FeaturesSection> {
),
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<FeaturesSection> {
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<FeaturesSection> {
? 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),
),
),
),