budget: icones carrées tonal (secondaryContainer)

This commit is contained in:
alexis 2026-07-12 00:33:59 +02:00
parent b321ebf7ed
commit 0a04139396
3 changed files with 32 additions and 19 deletions

View file

@ -94,13 +94,16 @@ class _YnabAppState extends ConsumerState<YnabApp> {
), ),
), ),
const SizedBox(height: 12), const SizedBox(height: 12),
DropdownButtonFormField<int>( DropdownMenu<int>(
value: accountId, initialSelection: accountId,
decoration: const InputDecoration(labelText: 'Compte'), label: const Text('Compte'),
items: accounts expandedInsets: EdgeInsets.zero,
.map((a) => DropdownMenuItem(value: a.id, child: Text(a.name))) dropdownMenuEntries: accounts
.map((a) => DropdownMenuEntry(value: a.id, label: a.name))
.toList(), .toList(),
onChanged: (v) => accountId = v, onSelected: (v) {
if (v != null) accountId = v;
},
), ),
], ],
), ),

View file

@ -97,16 +97,18 @@ class _AccountCard extends ConsumerWidget {
keyboardType: const TextInputType.numberWithOptions(decimal: true), keyboardType: const TextInputType.numberWithOptions(decimal: true),
), ),
const SizedBox(height: 12), const SizedBox(height: 12),
DropdownButtonFormField<String>( DropdownMenu<String>(
initialValue: type, initialSelection: type,
decoration: const InputDecoration(labelText: 'Type'), label: const Text('Type'),
items: const [ enableSearch: false,
DropdownMenuItem(value: 'checking', child: Text('Compte courant')), expandedInsets: EdgeInsets.zero,
DropdownMenuItem(value: 'savings', child: Text('Épargne')), dropdownMenuEntries: const [
DropdownMenuItem(value: 'credit', child: Text('Carte de crédit')), DropdownMenuEntry(value: 'checking', label: 'Compte courant'),
DropdownMenuItem(value: 'cash', child: Text('Espèces')), 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) { if (v != null) {
type = v; type = v;
setDialogState(() {}); setDialogState(() {});

View file

@ -176,10 +176,18 @@ class _CategoryRow extends ConsumerWidget {
dense: true, dense: true,
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
visualDensity: VisualDensity.compact, visualDensity: VisualDensity.compact,
leading: Icon( leading: Container(
categoryIcon(category.icon), width: 36,
size: 22, height: 36,
color: Theme.of(context).colorScheme.onSurfaceVariant, 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)), title: Text(category.name, style: Theme.of(context).textTheme.titleMedium?.copyWith(fontWeight: FontWeight.w600)),
trailing: Text( trailing: Text(