From 29959f75800559144a59b7792917fef471616898 Mon Sep 17 00:00:00 2001 From: Pete Gregory Date: Mon, 22 Dec 2025 23:24:46 +0000 Subject: [PATCH] remove hero buttons --- lib/components/pages/dashboard.dart | 63 +---------------------------- 1 file changed, 1 insertion(+), 62 deletions(-) diff --git a/lib/components/pages/dashboard.dart b/lib/components/pages/dashboard.dart index 38cd424..594884e 100644 --- a/lib/components/pages/dashboard.dart +++ b/lib/components/pages/dashboard.dart @@ -83,7 +83,6 @@ class _DashboardState extends State { HomepageStats? stats, ) { final colorScheme = Theme.of(context).colorScheme; - final isCompact = MediaQuery.of(context).size.width < 720; final greetingName = stats?.user?.fullName ?? auth.fullName ?? auth.username ?? 'there'; final totalMileage = stats?.totalMileage ?? 0; @@ -111,24 +110,7 @@ class _DashboardState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - isCompact - ? Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - _heroHeading(context, greetingName, colorScheme), - const SizedBox(height: 12), - _heroActions(context, colorScheme, wrap: true), - ], - ) - : Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: _heroHeading(context, greetingName, colorScheme), - ), - _heroActions(context, colorScheme, wrap: false), - ], - ), + _heroHeading(context, greetingName, colorScheme), const SizedBox(height: 18), Wrap( spacing: 12, @@ -314,49 +296,6 @@ class _DashboardState extends State { ); } - Widget _heroActions( - BuildContext context, - ColorScheme colorScheme, { - required bool wrap, - }) { - final buttons = [ - FilledButton.icon( - style: FilledButton.styleFrom( - backgroundColor: Colors.white, - foregroundColor: colorScheme.primary, - ), - onPressed: () => context.go('/add'), - icon: const Icon(Icons.add_circle_outline), - label: const Text('Add entry'), - ), - FilledButton.tonalIcon( - onPressed: () => context.go('/traction'), - icon: const Icon(Icons.train), - label: const Text('Traction'), - ), - FilledButton.tonalIcon( - onPressed: () => context.go('/trips'), - icon: const Icon(Icons.book), - label: const Text('Trips'), - ), - ]; - - if (wrap) { - return Wrap(spacing: 8, runSpacing: 8, children: buttons); - } - - return Row( - mainAxisSize: MainAxisSize.min, - children: [ - for (final btn in buttons) - Padding( - padding: const EdgeInsets.only(left: 8.0), - child: btn, - ), - ], - ); - } - Widget _buildOnThisDayCard(BuildContext context, DataService data) { final filtered = data.onThisDay .where((leg) => leg.beginTime.year != DateTime.now().year)