budget: icones carrées tonal (secondaryContainer)
This commit is contained in:
parent
b321ebf7ed
commit
0a04139396
15
lib/app.dart
15
lib/app.dart
|
|
@ -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;
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -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(() {});
|
||||||
|
|
|
||||||
|
|
@ -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(
|
||||||
|
width: 36,
|
||||||
|
height: 36,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Theme.of(context).colorScheme.secondaryContainer,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
categoryIcon(category.icon),
|
categoryIcon(category.icon),
|
||||||
size: 22,
|
size: 18,
|
||||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
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(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue