From 6b0edf870b11fd360252ce0bd5853a9106a68cdb Mon Sep 17 00:00:00 2001 From: alexis Date: Sat, 11 Jul 2026 23:38:27 +0200 Subject: [PATCH] budget: category icons, bigger font, larger gaps; cards: no border, r=20 --- lib/screens/budget_screen.dart | 29 ++++++++++++++++++++++++++--- lib/theme/app_theme.dart | 8 +++----- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/lib/screens/budget_screen.dart b/lib/screens/budget_screen.dart index beb6168..26035e8 100644 --- a/lib/screens/budget_screen.dart +++ b/lib/screens/budget_screen.dart @@ -80,7 +80,7 @@ class _CategoryGroupTile extends ConsumerWidget { ), if (expanded) ...cats.map((c) => _CategoryRow(categoryId: c.id)), - const Divider(height: 16), + const Divider(height: 32), ], ); } @@ -149,7 +149,7 @@ class _CategoryRow extends ConsumerWidget { } return Padding( - padding: const EdgeInsets.only(left: 8, bottom: 4), + padding: const EdgeInsets.only(left: 8, bottom: 12), child: Card( margin: EdgeInsets.zero, child: Padding( @@ -161,7 +161,12 @@ class _CategoryRow extends ConsumerWidget { dense: true, contentPadding: EdgeInsets.zero, visualDensity: VisualDensity.compact, - title: Text(category.name, style: Theme.of(context).textTheme.bodyMedium), + leading: Icon( + categoryIcon(category.icon), + size: 22, + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), + title: Text(category.name, style: Theme.of(context).textTheme.titleMedium?.copyWith(fontWeight: FontWeight.w600)), trailing: Text( formatCurrency(remaining), style: Theme.of(context).textTheme.bodyMedium?.copyWith( @@ -215,3 +220,21 @@ class _ExpandedGroupNotifier extends StateNotifier { final _expandedGroupProvider = StateNotifierProvider.family<_ExpandedGroupNotifier, bool, int>( (ref, id) => _ExpandedGroupNotifier()); + +IconData categoryIcon(String? name) { + switch (name) { + case 'home': return Icons.home; + case 'bolt': return Icons.bolt; + case 'water_drop': return Icons.water_drop; + case 'shield': return Icons.shield; + case 'shopping_cart': return Icons.shopping_cart; + case 'restaurant': return Icons.restaurant; + case 'local_gas_station': return Icons.local_gas_station; + case 'directions_bus': return Icons.directions_bus; + case 'tv': return Icons.tv; + case 'celebration': return Icons.celebration; + case 'savings': return Icons.savings; + case 'flight': return Icons.flight; + default: return Icons.category; + } +} diff --git a/lib/theme/app_theme.dart b/lib/theme/app_theme.dart index 9d005fd..7e83b63 100644 --- a/lib/theme/app_theme.dart +++ b/lib/theme/app_theme.dart @@ -30,10 +30,9 @@ final ThemeData ynabTheme = ThemeData( scaffoldBackgroundColor: kSurfaceBg, cardTheme: CardThemeData( color: kSurfaceCard, - elevation: 0, // M3 utilise plutôt les tonalités et outline qu'une grosse élévation + elevation: 0, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), - side: BorderSide(color: kDivider, width: 1), + borderRadius: BorderRadius.circular(20), ), clipBehavior: Clip.antiAlias, ), @@ -136,8 +135,7 @@ final ThemeData ynabDarkTheme = ThemeData( cardTheme: CardThemeData( elevation: 0, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), - side: const BorderSide(color: Color(0xFF43493E), width: 1), + borderRadius: BorderRadius.circular(20), ), clipBehavior: Clip.antiAlias, ),