fix dialog white screen: StatefulBuilder + remove Spacer from actions
This commit is contained in:
parent
5b4f3f7ec2
commit
993e4f62a1
|
|
@ -79,7 +79,8 @@ class _AccountCard extends ConsumerWidget {
|
|||
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (ctx) => AlertDialog(
|
||||
builder: (ctx) => StatefulBuilder(
|
||||
builder: (context, setDialogState) => AlertDialog(
|
||||
title: const Text('Modifier le compte'),
|
||||
content: SingleChildScrollView(
|
||||
child: Column(
|
||||
|
|
@ -97,7 +98,7 @@ class _AccountCard extends ConsumerWidget {
|
|||
),
|
||||
const SizedBox(height: 12),
|
||||
DropdownButtonFormField<String>(
|
||||
value: type,
|
||||
initialValue: type,
|
||||
decoration: const InputDecoration(labelText: 'Type'),
|
||||
items: const [
|
||||
DropdownMenuItem(value: 'checking', child: Text('Compte courant')),
|
||||
|
|
@ -106,7 +107,10 @@ class _AccountCard extends ConsumerWidget {
|
|||
DropdownMenuItem(value: 'cash', child: Text('Espèces')),
|
||||
],
|
||||
onChanged: (v) {
|
||||
if (v != null) type = v;
|
||||
if (v != null) {
|
||||
type = v;
|
||||
setDialogState(() {});
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
|
|
@ -121,7 +125,7 @@ class _AccountCard extends ConsumerWidget {
|
|||
style: TextButton.styleFrom(foregroundColor: Theme.of(context).colorScheme.error),
|
||||
child: const Text('Supprimer'),
|
||||
),
|
||||
const Spacer(),
|
||||
const SizedBox(width: 8),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(ctx),
|
||||
child: const Text('Annuler'),
|
||||
|
|
@ -143,6 +147,7 @@ class _AccountCard extends ConsumerWidget {
|
|||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
nameCtrl.dispose();
|
||||
balanceCtrl.dispose();
|
||||
|
|
|
|||
Loading…
Reference in a new issue