Skip to content

Commit 0e23789

Browse files
committed
refactor(discover): adjust source card layout and styling
- Increase height of source card list from 120 to 140 - Add horizontal padding to source cards - Remove margin from Card widget - Adjust source card width to 150
1 parent c256d94 commit 0e23789

File tree

1 file changed

+41
-34
lines changed

1 file changed

+41
-34
lines changed

lib/discover/view/discover_page.dart

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class _SourceCategoryRowState extends State<_SourceCategoryRow> {
198198
const SizedBox(height: AppSpacing.sm),
199199
// Horizontally scrolling list of source cards.
200200
SizedBox(
201-
height: 120,
201+
height: 140,
202202
child: LayoutBuilder(
203203
builder: (context, constraints) {
204204
final listView = ListView.builder(
@@ -272,43 +272,50 @@ class _SourceCard extends StatelessWidget {
272272

273273
return SizedBox(
274274
width: 150,
275-
child: Card(
276-
margin: const EdgeInsets.symmetric(horizontal: AppSpacing.sm),
277-
clipBehavior: Clip.antiAlias,
278-
child: InkWell(
279-
onTap: () => context.pushNamed(
280-
Routes.entityDetailsName,
281-
pathParameters: {'type': ContentType.source.name, 'id': source.id},
282-
),
283-
child: Column(
284-
mainAxisAlignment: MainAxisAlignment.center,
285-
children: [
286-
Expanded(
287-
child: Padding(
288-
padding: const EdgeInsets.all(AppSpacing.md),
289-
child: Image.network(
290-
source.logoUrl,
291-
fit: BoxFit.contain,
292-
errorBuilder: (context, error, stackTrace) => Icon(
293-
Icons.source_outlined,
294-
size: AppSpacing.xxl,
295-
color: theme.colorScheme.onSurfaceVariant,
275+
child: Padding(
276+
padding: const EdgeInsets.symmetric(horizontal: AppSpacing.sm),
277+
child: Card(
278+
clipBehavior: Clip.antiAlias,
279+
child: InkWell(
280+
onTap: () => context.pushNamed(
281+
Routes.entityDetailsName,
282+
pathParameters: {
283+
'type': ContentType.source.name,
284+
'id': source.id,
285+
},
286+
),
287+
child: Column(
288+
mainAxisAlignment: MainAxisAlignment.center,
289+
children: [
290+
Expanded(
291+
child: Padding(
292+
padding: const EdgeInsets.all(AppSpacing.md),
293+
child: Image.network(
294+
source.logoUrl,
295+
fit: BoxFit.contain,
296+
errorBuilder: (context, error, stackTrace) => Icon(
297+
Icons.source_outlined,
298+
size: AppSpacing.xxl,
299+
color: theme.colorScheme.onSurfaceVariant,
300+
),
296301
),
297302
),
298303
),
299-
),
300-
const SizedBox(height: AppSpacing.sm),
301-
Padding(
302-
padding: const EdgeInsets.symmetric(horizontal: AppSpacing.xs),
303-
child: Text(
304-
source.name,
305-
style: theme.textTheme.bodyMedium,
306-
textAlign: TextAlign.center,
307-
maxLines: 1,
308-
overflow: TextOverflow.ellipsis,
304+
Padding(
305+
padding: const EdgeInsets.symmetric(
306+
horizontal: AppSpacing.xs,
307+
),
308+
child: Text(
309+
source.name,
310+
style: theme.textTheme.bodyMedium,
311+
textAlign: TextAlign.center,
312+
maxLines: 1,
313+
overflow: TextOverflow.ellipsis,
314+
),
309315
),
310-
),
311-
],
316+
const SizedBox(height: AppSpacing.sm),
317+
],
318+
),
312319
),
313320
),
314321
),

0 commit comments

Comments
 (0)