outsourced all methods and dialogs as far as possible (I think)
This commit is contained in:
58
lib/screens/excursion/widgets/letzter_niederschlag.dart
Normal file
58
lib/screens/excursion/widgets/letzter_niederschlag.dart
Normal file
@@ -0,0 +1,58 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
class LetzterNiederschlag extends StatefulWidget {
|
||||
final TextEditingController controller;
|
||||
|
||||
const LetzterNiederschlag({super.key, required this.controller});
|
||||
|
||||
@override
|
||||
LetzterNiederschlagState createState() => LetzterNiederschlagState();
|
||||
}
|
||||
|
||||
class LetzterNiederschlagState extends State<LetzterNiederschlag> {
|
||||
String? selectedValue; // Variable für den ausgewählten Wert
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DropdownButton<String>(
|
||||
isExpanded: true,
|
||||
value: selectedValue,
|
||||
hint: Text(AppLocalizations.of(context)!.letzterNiederschlag),
|
||||
onChanged: (String? newValue) {
|
||||
setState(() {
|
||||
selectedValue = newValue; // Aktualisiere den ausgewählten Wert
|
||||
});
|
||||
},
|
||||
items: [
|
||||
DropdownMenuItem<String>(
|
||||
value: "aktuell",
|
||||
child: Text(AppLocalizations.of(context)!.aktuell),
|
||||
),
|
||||
DropdownMenuItem<String>(
|
||||
value: "selberMorgen",
|
||||
child: Text(AppLocalizations.of(context)!.selberMorgen),
|
||||
),
|
||||
DropdownMenuItem<String>(
|
||||
value: "nacht",
|
||||
child: Text(AppLocalizations.of(context)!.letzteNacht),
|
||||
),
|
||||
DropdownMenuItem<String>(
|
||||
value: "vortag",
|
||||
child: Text(AppLocalizations.of(context)!.vortag),
|
||||
),
|
||||
DropdownMenuItem<String>(
|
||||
value: "vor23Tagen",
|
||||
child: Text(AppLocalizations.of(context)!.vor23Tagen),
|
||||
),
|
||||
DropdownMenuItem<String>(
|
||||
value: "vor46Tagen",
|
||||
child: Text(AppLocalizations.of(context)!.vor46Tagen),
|
||||
),
|
||||
DropdownMenuItem<String>(
|
||||
value: "vor1Woche",
|
||||
child: Text(AppLocalizations.of(context)!.vor1Woche),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user