Skip to content

Commit 5b4f306

Browse files
committed
feat(widgets): replace source icon with source image in headline row
- Add Image.network widget to display source logo - Implement errorBuilder to fallback to default icon on error - Use ClipRRect to apply rounded corners to the source image - Adjust layout to maintain consistent spacing and sizing
1 parent 1a87fc1 commit 5b4f306

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

lib/shared/widgets/feed_core/headline_source_row.dart

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,21 @@ class HeadlineSourceRow extends StatelessWidget {
6060
child: Row(
6161
mainAxisSize: MainAxisSize.min,
6262
children: [
63-
Icon(
64-
Icons.source_outlined,
65-
size: AppSpacing.md,
66-
color: colorScheme.onSurfaceVariant,
63+
SizedBox(
64+
width: AppSpacing.md,
65+
height: AppSpacing.md,
66+
child: ClipRRect(
67+
borderRadius: BorderRadius.circular(AppSpacing.xs / 2),
68+
child: Image.network(
69+
headline.source.logoUrl,
70+
fit: BoxFit.cover,
71+
errorBuilder: (context, error, stackTrace) => Icon(
72+
Icons.source_outlined,
73+
size: AppSpacing.md,
74+
color: colorScheme.onSurfaceVariant,
75+
),
76+
),
77+
),
6778
),
6879
const SizedBox(width: AppSpacing.xs),
6980
Flexible(

0 commit comments

Comments
 (0)