From 619c0b83a39c0c3046c564bf51dcc5e5892e8a5a Mon Sep 17 00:00:00 2001 From: Nico Date: Thu, 29 May 2025 15:19:13 +0200 Subject: [PATCH] made spur gefunden like in email described --- lib/screens/excursion/excursion_main.dart | 10 +- .../excursion/widgets/spur_gefunden.dart | 211 +++++++++--------- 2 files changed, 116 insertions(+), 105 deletions(-) diff --git a/lib/screens/excursion/excursion_main.dart b/lib/screens/excursion/excursion_main.dart index 4c9fc00..a58fdaa 100644 --- a/lib/screens/excursion/excursion_main.dart +++ b/lib/screens/excursion/excursion_main.dart @@ -384,12 +384,12 @@ class _ExcursionMainState extends State { // ---------- Track found SpurGefunden( spurFund: rmap["SpurFund"]!["controller"]!, - spurLang: rmap["SpurLang"]!["controller"]!, - spurTiere: rmap["SpurTiere"]!["controller"]!, - spSicher: rmap["SpSicher"]!["controller"]!, + // spurLang: rmap["SpurLang"]!["controller"]!, + // spurTiere: rmap["SpurTiere"]!["controller"]!, + // spSicher: rmap["SpSicher"]!["controller"]!, welpenSp: rmap["WelpenSp"]!["controller"]!, - welpenAnz: rmap["WelpenAnz"]!["controller"]!, - wpSicher: rmap["WpSicher"]!["controller"]!, + // welpenAnz: rmap["WelpenAnz"]!["controller"]!, + // wpSicher: rmap["WpSicher"]!["controller"]!, ), const SizedBox(height: 20), // ---------- Counts diff --git a/lib/screens/excursion/widgets/spur_gefunden.dart b/lib/screens/excursion/widgets/spur_gefunden.dart index bf69467..45d2e71 100644 --- a/lib/screens/excursion/widgets/spur_gefunden.dart +++ b/lib/screens/excursion/widgets/spur_gefunden.dart @@ -3,22 +3,23 @@ import 'package:fforte/l10n/app_localizations.dart'; class SpurGefunden extends StatefulWidget { final TextEditingController spurFund; - final TextEditingController spurLang; - final TextEditingController spurTiere; - final TextEditingController spSicher; + // final TextEditingController spurLang; + // final TextEditingController spurTiere; + // final TextEditingController spSicher; final TextEditingController welpenSp; - final TextEditingController welpenAnz; - final TextEditingController wpSicher; + // final TextEditingController welpenAnz; + // final TextEditingController wpSicher; const SpurGefunden( {super.key, required this.spurFund, - required this.spurLang, - required this.spurTiere, - required this.spSicher, + // required this.spurLang, + // required this.spurTiere, + // required this.spSicher, required this.welpenSp, - required this.welpenAnz, - required this.wpSicher}); + // required this.welpenAnz, + // required this.wpSicher, + }); @override State createState() => _SpurGefundenState(); @@ -26,8 +27,8 @@ class SpurGefunden extends StatefulWidget { class _SpurGefundenState extends State { bool _spurFundChecked = false; - bool _spSicher = false; - bool _wpSicher = false; + // bool _spSicher = false; + // bool _wpSicher = false; bool _welpenSp = false; @override @@ -46,96 +47,106 @@ class _SpurGefundenState extends State { }); }, ), + Text(AppLocalizations.of(context)!.welpenSpurGefunden), + Checkbox( + value: _welpenSp, + onChanged: (val) { + setState(() { + _welpenSp = val ?? false; + widget.welpenSp.text = val ?? false ? "WelpenSp" : ""; + }); + }, + ), ], ), - Visibility( - visible: _spurFundChecked, - child: Column( - children: [ - Align( - alignment: Alignment.bottomLeft, - child: Text(AppLocalizations.of(context)!.gesLaengeAllerDokSpuren)), - TextField( - keyboardType: TextInputType.number, - controller: widget.spurLang, - ), - const SizedBox( - height: 30, - ), - Align( - alignment: Alignment.bottomLeft, - child: Text(AppLocalizations.of(context)!.maxAnzahlZusGefaehrdeterTiere)), - TextField( - keyboardType: TextInputType.number, - controller: widget.spurTiere, - ), - Row( - children: [ - Text(AppLocalizations.of(context)!.sicher), - Checkbox( - value: _spSicher, - onChanged: (val) { - setState(() { - _spSicher = val ?? false; - widget.spSicher.text = _spSicher ? "sicher" : "unsicher"; - }); - }), - ], - ), - const SizedBox( - height: 10, - ), - Row( - children: [ - Text(AppLocalizations.of(context)!.welpenSpurGefunden), - Checkbox( - value: _welpenSp, - onChanged: (val) { - setState(() { - _welpenSp = val ?? false; - }); - }, - ), - ], - ), - Visibility( - visible: _welpenSp, - child: Column( - children: [ - Align( - alignment: Alignment.bottomLeft, - child: Text(AppLocalizations.of(context)!.gesLaengeAllerDokSpuren)), - TextField( - keyboardType: TextInputType.number, - controller: widget.welpenSp, - ), - const SizedBox(height: 20,), - Align( - alignment: Alignment.bottomLeft, - child: Text(AppLocalizations.of(context)!.maxAnzahlZusGefaehrdeterTiere)), - TextField( - keyboardType: TextInputType.number, - controller: widget.welpenAnz, - ), - Row( - children: [ - Text(AppLocalizations.of(context)!.sicher), - Checkbox( - value: _wpSicher, - onChanged: (val) { - setState(() { - _wpSicher = val ?? false; - widget.spSicher.text = - _spSicher ? "sicher" : "unsicher"; - }); - }), - ], - ), - ], - )), - ], - ), - ), + // Visibility( + // visible: _spurFundChecked, + // child: Column( + // children: [ + // Align( + // alignment: Alignment.bottomLeft, + // child: Text(AppLocalizations.of(context)!.gesLaengeAllerDokSpuren)), + // TextField( + // keyboardType: TextInputType.number, + // controller: widget.spurLang, + // ), + // const SizedBox( + // height: 30, + // ), + // Align( + // alignment: Alignment.bottomLeft, + // child: Text(AppLocalizations.of(context)!.maxAnzahlZusGefaehrdeterTiere)), + // TextField( + // keyboardType: TextInputType.number, + // controller: widget.spurTiere, + // ), + // Row( + // children: [ + // Text(AppLocalizations.of(context)!.sicher), + // Checkbox( + // value: _spSicher, + // onChanged: (val) { + // setState(() { + // _spSicher = val ?? false; + // widget.spSicher.text = _spSicher ? "sicher" : "unsicher"; + // }); + // }), + // ], + // ), + // const SizedBox( + // height: 10, + // ), + // Row( + // children: [ + // Text(AppLocalizations.of(context)!.welpenSpurGefunden), + // Checkbox( + // value: _welpenSp, + // onChanged: (val) { + // setState(() { + // _welpenSp = val ?? false; + // }); + // }, + // ), + // ], + // ), + // Visibility( + // visible: _welpenSp, + // child: Column( + // children: [ + // Align( + // alignment: Alignment.bottomLeft, + // child: Text(AppLocalizations.of(context)!.gesLaengeAllerDokSpuren)), + // TextField( + // keyboardType: TextInputType.number, + // controller: widget.welpenSp, + // ), + // const SizedBox(height: 20,), + // Align( + // alignment: Alignment.bottomLeft, + // child: Text(AppLocalizations.of(context)!.maxAnzahlZusGefaehrdeterTiere)), + // TextField( + // keyboardType: TextInputType.number, + // controller: widget.welpenAnz, + // ), + // Row( + // children: [ + // Text(AppLocalizations.of(context)!.sicher), + // Checkbox( + // value: _wpSicher, + // onChanged: (val) { + // setState(() { + // _wpSicher = val ?? false; + // widget.spSicher.text = + // _spSicher ? "sicher" : "unsicher"; + // }); + // }), + // ], + // ), + // ], + // )), + // ], + // ), + // ), ], ); }