let AI comment everything because well... yeah...
This commit is contained in:
@@ -1,7 +1,24 @@
|
||||
// * Widget for selecting the timing of last precipitation
|
||||
// * Features:
|
||||
// * - Dropdown menu for time selection
|
||||
// * - Multiple predefined time ranges
|
||||
// * - Localized time descriptions
|
||||
// * Available time ranges:
|
||||
// * - Currently raining
|
||||
// * - Same morning
|
||||
// * - Last night
|
||||
// * - Previous day/evening
|
||||
// * - 2-3 days ago
|
||||
// * - 4-6 days ago
|
||||
// * - 1 week or more
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fforte/l10n/app_localizations.dart';
|
||||
|
||||
/// Widget for recording when the last precipitation occurred
|
||||
/// Used to track weather conditions during wildlife monitoring
|
||||
class LetzterNiederschlag extends StatefulWidget {
|
||||
/// Controller for storing the selected precipitation timing
|
||||
final TextEditingController controller;
|
||||
|
||||
const LetzterNiederschlag({super.key, required this.controller});
|
||||
@@ -10,11 +27,14 @@ class LetzterNiederschlag extends StatefulWidget {
|
||||
LetzterNiederschlagState createState() => LetzterNiederschlagState();
|
||||
}
|
||||
|
||||
/// State class for the last precipitation selection widget
|
||||
class LetzterNiederschlagState extends State<LetzterNiederschlag> {
|
||||
late String? selectedValue; // Variable für den ausgewählten Wert
|
||||
/// Currently selected precipitation timing value
|
||||
late String? selectedValue;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// Initialize selection from controller
|
||||
if (widget.controller.text == "") {
|
||||
selectedValue = null;
|
||||
} else {
|
||||
@@ -36,30 +56,37 @@ class LetzterNiederschlagState extends State<LetzterNiederschlag> {
|
||||
});
|
||||
},
|
||||
items: [
|
||||
// Currently raining option
|
||||
DropdownMenuItem<String>(
|
||||
value: "aktuell",
|
||||
child: Text(AppLocalizations.of(context)!.aktuell),
|
||||
),
|
||||
// Same morning option
|
||||
DropdownMenuItem<String>(
|
||||
value: "am selben Morgen",
|
||||
child: Text(AppLocalizations.of(context)!.selberMorgen),
|
||||
),
|
||||
// Last night option
|
||||
DropdownMenuItem<String>(
|
||||
value: "in der Nacht",
|
||||
child: Text(AppLocalizations.of(context)!.letzteNacht),
|
||||
),
|
||||
// Previous day/evening option
|
||||
DropdownMenuItem<String>(
|
||||
value: "am Tag oder Abend zuvor",
|
||||
child: Text(AppLocalizations.of(context)!.vortag),
|
||||
),
|
||||
// 2-3 days ago option
|
||||
DropdownMenuItem<String>(
|
||||
value: "vor 2 bis 3 Tagen",
|
||||
child: Text(AppLocalizations.of(context)!.vor23Tagen),
|
||||
),
|
||||
// 4-6 days ago option
|
||||
DropdownMenuItem<String>(
|
||||
value: "vor 4 bis 6 Tagen",
|
||||
child: Text(AppLocalizations.of(context)!.vor46Tagen),
|
||||
),
|
||||
// 1 week or more option
|
||||
DropdownMenuItem<String>(
|
||||
value: ">=1 Woche",
|
||||
child: Text(AppLocalizations.of(context)!.vor1Woche),
|
||||
|
||||
Reference in New Issue
Block a user