diff --git a/lib/app.dart b/lib/app.dart index c17e3eb..56733f8 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -94,13 +94,16 @@ class _YnabAppState extends ConsumerState { ), ), const SizedBox(height: 12), - DropdownButtonFormField( - value: accountId, - decoration: const InputDecoration(labelText: 'Compte'), - items: accounts - .map((a) => DropdownMenuItem(value: a.id, child: Text(a.name))) + DropdownMenu( + initialSelection: accountId, + label: const Text('Compte'), + expandedInsets: EdgeInsets.zero, + dropdownMenuEntries: accounts + .map((a) => DropdownMenuEntry(value: a.id, label: a.name)) .toList(), - onChanged: (v) => accountId = v, + onSelected: (v) { + if (v != null) accountId = v; + }, ), ], ), diff --git a/lib/screens/accounts_screen.dart b/lib/screens/accounts_screen.dart index c66bc92..74fbbbb 100644 --- a/lib/screens/accounts_screen.dart +++ b/lib/screens/accounts_screen.dart @@ -97,16 +97,18 @@ class _AccountCard extends ConsumerWidget { keyboardType: const TextInputType.numberWithOptions(decimal: true), ), const SizedBox(height: 12), - DropdownButtonFormField( - initialValue: type, - decoration: const InputDecoration(labelText: 'Type'), - items: const [ - DropdownMenuItem(value: 'checking', child: Text('Compte courant')), - DropdownMenuItem(value: 'savings', child: Text('Épargne')), - DropdownMenuItem(value: 'credit', child: Text('Carte de crédit')), - DropdownMenuItem(value: 'cash', child: Text('Espèces')), + DropdownMenu( + initialSelection: type, + label: const Text('Type'), + enableSearch: false, + expandedInsets: EdgeInsets.zero, + dropdownMenuEntries: const [ + DropdownMenuEntry(value: 'checking', label: 'Compte courant'), + DropdownMenuEntry(value: 'savings', label: 'Épargne'), + DropdownMenuEntry(value: 'credit', label: 'Carte de crédit'), + DropdownMenuEntry(value: 'cash', label: 'Espèces'), ], - onChanged: (v) { + onSelected: (v) { if (v != null) { type = v; setDialogState(() {}); diff --git a/lib/screens/budget_screen.dart b/lib/screens/budget_screen.dart index 46d962d..5973de5 100644 --- a/lib/screens/budget_screen.dart +++ b/lib/screens/budget_screen.dart @@ -176,10 +176,18 @@ class _CategoryRow extends ConsumerWidget { dense: true, contentPadding: EdgeInsets.zero, visualDensity: VisualDensity.compact, - leading: Icon( - categoryIcon(category.icon), - size: 22, - color: Theme.of(context).colorScheme.onSurfaceVariant, + leading: Container( + width: 36, + height: 36, + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.secondaryContainer, + borderRadius: BorderRadius.circular(8), + ), + child: Icon( + categoryIcon(category.icon), + size: 18, + color: Theme.of(context).colorScheme.onSecondaryContainer, + ), ), title: Text(category.name, style: Theme.of(context).textTheme.titleMedium?.copyWith(fontWeight: FontWeight.w600)), trailing: Text(