fixed hinweise values

This commit is contained in:
Nico
2025-05-27 22:45:58 +02:00
parent 817b087ce3
commit 6980dfc4de
2 changed files with 8 additions and 7 deletions

View File

@@ -263,7 +263,6 @@ class _ExcursionMainState extends State<ExcursionMain> {
// ---------- Bima number // ---------- Bima number
const Divider(), const Divider(),
const SizedBox(height: 10), const SizedBox(height: 10),
ClipRRect( ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(10)), borderRadius: BorderRadius.all(Radius.circular(10)),
child: ExpansionPanelList( child: ExpansionPanelList(

View File

@@ -48,17 +48,18 @@ class _HinweiseState extends State<Hinweise> {
widget.hinweise.text = ""; widget.hinweise.text = "";
for (String key in props.keys) { for (String key in props.keys) {
if (!firstRun) { if (!firstRun && props[key]!) {
widget.hinweise.text += ";"; widget.hinweise.text += ",";
} }
if (key == "sonstiges") { if (key == "sonstiges") {
widget.hinweise.text += "$key:${sonstigesController.text}"; widget.hinweise.text += sonstigesController.text;
} else { } else if (props[key]!){
widget.hinweise.text += "$key:${props[key]}"; widget.hinweise.text += key;
} }
firstRun = false; firstRun = false;
} }
debugPrint(widget.hinweise.text);
} }
@override @override
@@ -97,7 +98,8 @@ class _HinweiseState extends State<Hinweise> {
title: Text(AppLocalizations.of(context)!.sonstiges), title: Text(AppLocalizations.of(context)!.sonstiges),
value: sonstigesChecked, value: sonstigesChecked,
onChanged: (bool? value) { onChanged: (bool? value) {
setState(() => sonstigesChecked = value ?? false); if (!value!) sonstigesController.text = "";
setState(() => sonstigesChecked = value);
updateController(); updateController();
}), }),
if (sonstigesChecked) if (sonstigesChecked)