Update UI for toggling applications on older keys

This commit is contained in:
Dennis Fokin 2023-11-10 12:26:17 +01:00
parent 533c2d26d7
commit 4081361163
No known key found for this signature in database
GPG Key ID: 870B88256690D8BC

View File

@ -76,19 +76,23 @@ class _ModeForm extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column(children: [ return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
...UsbInterface.values.map( Align(
(iface) => CheckboxListTile( alignment: Alignment.topLeft,
title: Text(iface.name.toUpperCase()), child: Padding(
value: iface.value & interfaces != 0, padding: const EdgeInsets.symmetric(vertical: 8.0),
onChanged: (_) { child: Wrap(
onChanged(interfaces ^ iface.value); spacing: 8,
}, runSpacing: 16,
), children: UsbInterface.values
), .map((iface) => FilterChip(
Text(interfaces == 0 label: Text(iface.name.toUpperCase()),
? AppLocalizations.of(context)!.l_min_one_interface selected: iface.value & interfaces != 0,
: ''), onSelected: (_) {
onChanged(interfaces ^ iface.value);
},
))
.toList()))),
]); ]);
} }
} }
@ -309,7 +313,10 @@ class _ManagementScreenState extends ConsumerState<ManagementScreen> {
padding: const EdgeInsets.symmetric(horizontal: 18.0), padding: const EdgeInsets.symmetric(horizontal: 18.0),
child: _buildCapabilitiesForm(context, ref, info), child: _buildCapabilitiesForm(context, ref, info),
) )
: _buildModeForm(context, ref, info), : Padding(
padding: const EdgeInsets.symmetric(horizontal: 18.0),
child: _buildModeForm(context, ref, info),
)
], ],
); );
}, },