59 lines
1.8 KiB
Dart
59 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:fforte/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),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|