fixed alignment in anzahlen, added and finished 3rd step created hinweise widget, removed domain, changed letzter_niederschlag.dart to Dropdown

time
This commit is contained in:
nico
2025-03-17 22:34:38 +01:00
parent 1791876eec
commit 5086c4f2cc
6 changed files with 171 additions and 88 deletions

View File

@@ -1,7 +1,27 @@
import 'package:flutter/material.dart';
class Anzahlen extends StatefulWidget {
const Anzahlen({super.key});
final TextEditingController losungAnz;
final TextEditingController losungGes;
final TextEditingController losungGen;
final TextEditingController urinAnz;
final TextEditingController urinGen;
final TextEditingController oestrAnz;
final TextEditingController oestrGen;
final TextEditingController haarAnz;
final TextEditingController haarGen;
const Anzahlen(
{super.key,
required this.losungAnz,
required this.losungGes,
required this.losungGen,
required this.urinAnz,
required this.urinGen,
required this.oestrAnz,
required this.oestrGen,
required this.haarAnz,
required this.haarGen});
@override
AnzahlenState createState() => AnzahlenState();
@@ -41,7 +61,7 @@ class AnzahlenState extends State<Anzahlen> {
child: Align(
alignment: Alignment.bottomLeft,
child: Text(
"daven eingesammelt",
"davon eingesammelt",
)),
),
const SizedBox(
@@ -57,13 +77,14 @@ class AnzahlenState extends State<Anzahlen> {
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
flex: 6,
child: Align(
alignment: Alignment.bottomLeft,
child: Text(
"daven Genetikproben",
"davon Genetikproben",
),
),
),
@@ -76,9 +97,9 @@ class AnzahlenState extends State<Anzahlen> {
),
],
),
const Divider(height: 40,),
const Divider(
height: 40,
),
Row(
children: [
Expanded(
@@ -104,7 +125,7 @@ class AnzahlenState extends State<Anzahlen> {
child: Align(
alignment: Alignment.bottomLeft,
child: Text(
"daven Genetikproben",
"davon Genetikproben",
)),
),
const SizedBox(
@@ -119,9 +140,9 @@ class AnzahlenState extends State<Anzahlen> {
),
],
),
const Divider(height: 40,),
const Divider(
height: 40,
),
Row(
children: [
Expanded(
@@ -147,7 +168,7 @@ class AnzahlenState extends State<Anzahlen> {
child: Align(
alignment: Alignment.bottomLeft,
child: Text(
"daven Genetikproben",
"davon Genetikproben",
)),
),
const SizedBox(
@@ -162,9 +183,9 @@ class AnzahlenState extends State<Anzahlen> {
),
],
),
const Divider(height: 40,),
const Divider(
height: 40,
),
Row(
children: [
Expanded(
@@ -190,7 +211,7 @@ class AnzahlenState extends State<Anzahlen> {
child: Align(
alignment: Alignment.bottomLeft,
child: Text(
"daven Genetikproben",
"davon Genetikproben",
)),
),
const SizedBox(

View File

@@ -0,0 +1,18 @@
import 'package:flutter/material.dart';
class Hinweise extends StatefulWidget {
const Hinweise({super.key});
@override
State<Hinweise> createState() => _HinweiseState();
}
class _HinweiseState extends State<Hinweise> {
@override
Widget build(BuildContext context) {
return SizedBox(
height: 30,
child: const Placeholder());
}
}

View File

@@ -11,34 +11,47 @@ class LetzterNiederschlag extends StatefulWidget {
}
class LetzterNiederschlagState extends State<LetzterNiederschlag> {
String? selectedValue; // Variable für den ausgewählten Wert
@override
Widget build(BuildContext context) {
return DropdownMenu<String>(
controller: widget.controller,
label: Text(AppLocalizations.of(context)!.letzterNiederschlag),
requestFocusOnTap: true,
dropdownMenuEntries: [
DropdownMenuEntry(
value: "aktuell",
label: AppLocalizations.of(context)!.aktuell),
DropdownMenuEntry(
value: "selberMorgen",
label: AppLocalizations.of(context)!.selberMorgen),
DropdownMenuEntry(
value: "nacht",
label: AppLocalizations.of(context)!.nacht),
DropdownMenuEntry(
value: "vortag",
label: AppLocalizations.of(context)!.vortag),
DropdownMenuEntry(
value: "vor23Tagen",
label: AppLocalizations.of(context)!.vor23Tagen),
DropdownMenuEntry(
value: "vor46Tagen",
label: AppLocalizations.of(context)!.vor46Tagen),
DropdownMenuEntry(
value: "vor1Woche",
label: AppLocalizations.of(context)!.vor1Woche)
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)!.nacht),
),
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),
),
],
);
}