diff --git a/lib/l10n/app_de.arb b/lib/l10n/app_de.arb index b383548..b71f135 100644 --- a/lib/l10n/app_de.arb +++ b/lib/l10n/app_de.arb @@ -113,5 +113,7 @@ "gaststreitkraefte": "Gaststreitkräfte", "nneBund": "NNE Bund", "geschaeftsliegenschaftAGV": "Geschäftsliegenschaft/AGV", - "kein": "Kein" + "kein": "Kein", + "mHund": "Hund dabei", + "mLeine": "Mit Leine" } \ No newline at end of file diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 37b8ab9..5833ec2 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -557,14 +557,19 @@ "kein": "None", "@kein": { "description": "BIMA kein radiobutton" +}, + +"mHund": "With dog", +"@mHund": { +"description": "mHund radiobutton" +}, + +"mLeine": "With Dog leash", +"@mLeine": { +"description": "mLeine radiobutten" } - - - - - } \ No newline at end of file diff --git a/lib/screens/Excursion/excursion_main.dart b/lib/screens/Excursion/excursion_main.dart index ecb5830..ca9b4b0 100644 --- a/lib/screens/Excursion/excursion_main.dart +++ b/lib/screens/Excursion/excursion_main.dart @@ -25,8 +25,8 @@ class _ExcursionMainState extends State { "Teilnehm": TextEditingController(), "Jahr": TextEditingController(), "Dauer": TextEditingController(), - "HundDabei": TextEditingController(), - "MitLeine": TextEditingController(), + "MHund": TextEditingController(), + "MLeine": TextEditingController(), "BLand": TextEditingController(), "Lkr": TextEditingController(), "BeiOrt": TextEditingController(), @@ -75,6 +75,12 @@ class _ExcursionMainState extends State { const SizedBox( height: 10, ), + + // Hund u Leine + + const SizedBox( + height: 10, + ), VarTextField( textController: getTextFields()["BLand"]!, localization: AppLocalizations.of(context)!.bland, diff --git a/lib/screens/Excursion/widgets/hund_u_leine.dart b/lib/screens/Excursion/widgets/hund_u_leine.dart new file mode 100644 index 0000000..92a08e2 --- /dev/null +++ b/lib/screens/Excursion/widgets/hund_u_leine.dart @@ -0,0 +1,92 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; + +class HundULeine extends StatefulWidget { + final Function(String) onMHundChanged; + + const HundULeine({super.key, required this.onMHundChanged}); + + @override + HundULeineState createState() => HundULeineState(); +} + +class HundULeineState extends State { + String? _selectedValue; + TextEditingController controller = TextEditingController(); + bool visible = false; + + void onChanged(String mHund, String name, String mLeine) { + + } + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Text(AppLocalizations.of(context)!.mHund), + ListTile( + visualDensity: const VisualDensity(vertical: -4), + title: Text(AppLocalizations.of(context)!.ja), + leading: Radio( + value: "ja", + groupValue: _selectedValue, + onChanged: (value) { + setState(() { + _selectedValue = value; + visible = value == "ja" ? true : false; + }); + }, + ), + ), + ListTile( + visualDensity: const VisualDensity(vertical: -4), + title: Text(AppLocalizations.of(context)!.nein), + leading: Radio( + value: "nein", + groupValue: _selectedValue, + onChanged: (value) { + setState(() { + _selectedValue = value; + visible = value == "ja" ? true : false; + }); + }, + ), + ), + if (visible) ...[ + TextField( + controller: controller, + ), + Text(AppLocalizations.of(context)!.mLeine), + ListTile( + visualDensity: const VisualDensity(vertical: -4), + title: Text(AppLocalizations.of(context)!.ja), + leading: Radio( + value: "ja", + groupValue: _selectedValue, + onChanged: (value) { + setState(() { + _selectedValue = value; + widget.onMHundChanged(value!); + }); + }, + ), + ), + ListTile( + visualDensity: const VisualDensity(vertical: -4), + title: Text(AppLocalizations.of(context)!.nein), + leading: Radio( + value: "nein", + groupValue: _selectedValue, + onChanged: (value) { + setState(() { + _selectedValue = value; + widget.onMHundChanged(value!); + }); + }, + ), + ), + ] + ], + ); + } +} diff --git a/lib/screens/Excursion/widgets/hund_u_leine.dart~ b/lib/screens/Excursion/widgets/hund_u_leine.dart~ new file mode 100644 index 0000000..e69de29