Skip to content

Commit afe941c

Browse files
committed
reafctor(dashboard): enhance the dashboard's summary statistics section to improve responsiveness.
1 parent a099827 commit afe941c

File tree

1 file changed

+21
-24
lines changed

1 file changed

+21
-24
lines changed

lib/dashboard/view/dashboard_page.dart

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,24 @@ class _DashboardPageState extends State<DashboardPage> {
5858
return ListView(
5959
padding: const EdgeInsets.all(AppSpacing.lg),
6060
children: [
61-
Row(
61+
Wrap(
62+
spacing: AppSpacing.lg,
63+
runSpacing: AppSpacing.lg,
6264
children: [
63-
Expanded(
64-
child: _SummaryCard(
65-
icon: Icons.article_outlined,
66-
title: l10n.totalHeadlines,
67-
value: summary.headlineCount.toString(),
68-
),
65+
_SummaryCard(
66+
icon: Icons.article_outlined,
67+
title: l10n.totalHeadlines,
68+
value: summary.headlineCount.toString(),
6969
),
70-
const SizedBox(width: AppSpacing.lg),
71-
Expanded(
72-
child: _SummaryCard(
73-
icon: Icons.category_outlined,
74-
title: l10n.totalCategories,
75-
value: summary.categoryCount.toString(),
76-
),
70+
_SummaryCard(
71+
icon: Icons.category_outlined,
72+
title: l10n.totalCategories,
73+
value: summary.categoryCount.toString(),
7774
),
78-
const SizedBox(width: AppSpacing.lg),
79-
Expanded(
80-
child: _SummaryCard(
81-
icon: Icons.source_outlined,
82-
title: l10n.totalSources,
83-
value: summary.sourceCount.toString(),
84-
),
75+
_SummaryCard(
76+
icon: Icons.source_outlined,
77+
title: l10n.totalSources,
78+
value: summary.sourceCount.toString(),
8579
),
8680
],
8781
),
@@ -100,7 +94,9 @@ class _DashboardPageState extends State<DashboardPage> {
10094
flex: 1,
10195
child: Column(
10296
children: [
103-
_SystemStatusCard(status: appConfig.appOperationalStatus),
97+
_SystemStatusCard(
98+
status: appConfig.appOperationalStatus,
99+
),
104100
const SizedBox(height: AppSpacing.lg),
105101
const _QuickActionsCard(),
106102
],
@@ -269,8 +265,9 @@ class _RecentHeadlinesCard extends StatelessWidget {
269265
child: Center(
270266
child: Text(
271267
l10n.noRecentHeadlines,
272-
style: theme.textTheme.bodyMedium
273-
?.copyWith(color: theme.colorScheme.onSurfaceVariant),
268+
style: theme.textTheme.bodyMedium?.copyWith(
269+
color: theme.colorScheme.onSurfaceVariant,
270+
),
274271
),
275272
),
276273
)

0 commit comments

Comments
 (0)