93 lines
2.6 KiB
Dart
93 lines
2.6 KiB
Dart
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<HundULeine> {
|
|
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<String>(
|
|
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<String>(
|
|
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<String>(
|
|
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<String>(
|
|
value: "nein",
|
|
groupValue: _selectedValue,
|
|
onChanged: (value) {
|
|
setState(() {
|
|
_selectedValue = value;
|
|
widget.onMHundChanged(value!);
|
|
});
|
|
},
|
|
),
|
|
),
|
|
]
|
|
],
|
|
);
|
|
}
|
|
}
|