added niederschlag widget

This commit is contained in:
Nico
2024-12-29 19:24:43 +01:00
parent f1f5019f58
commit e0409f972c
5 changed files with 88 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
import 'package:animations/animations.dart';
import 'package:fforte/screens/Excursion/widgets/bima_nutzer.dart';
import 'package:fforte/screens/Excursion/widgets/hund_u_leine.dart';
import 'package:fforte/screens/Excursion/widgets/letzter_niederschlag.dart~';
import 'package:fforte/screens/sharedWidgets/datum.dart';
import 'package:fforte/screens/sharedWidgets/var_text_field.dart';
import 'package:flutter/material.dart';
@@ -14,11 +15,7 @@ class ExcursionMain extends StatefulWidget {
}
class _ExcursionMainState extends State<ExcursionMain> {
// alles TextEditingController
// TODO:
// - Hund dabei u mit leine u fragen was dieses nein textfeld soll
// - Input vorgabe fuer dauer feld
// all TextEditingController because its easier
Map<String, TextEditingController> getTextFields() {
Map<String, TextEditingController> rmap = {
@@ -84,6 +81,8 @@ class _ExcursionMainState extends State<ExcursionMain> {
return rmap;
}
int currentStep = 0;
@override
Widget build(BuildContext context) {
List<Step> getSteps() => [
@@ -206,16 +205,18 @@ class _ExcursionMainState extends State<ExcursionMain> {
localization: "Wetter",
dbName: "Wetter",
required: false),
const SizedBox(height: 10),
VarTextField(
textController: getTextFields()["Temperat"]!,
localization: "Temperatur",
dbName: "Temperat",
required: false),
const SizedBox(height: 10),
LetzterNiederschlag(controller: getTextFields()["RegenVor"]!),
],
))
];
int currentStep = 0;
return Scaffold(
appBar: AppBar(
@@ -233,7 +234,7 @@ class _ExcursionMainState extends State<ExcursionMain> {
);
},
child: Stepper(
key: ValueKey(currentStep),
key: ValueKey<int>(currentStep),
steps: getSteps(),
currentStep: currentStep,
onStepTapped: (value) {
@@ -241,13 +242,16 @@ class _ExcursionMainState extends State<ExcursionMain> {
currentStep = value;
});
},
onStepContinue: () async {
final bool isLastStep = currentStep == getSteps().length - 1;
onStepContinue: () {
final isLastStep = currentStep == getSteps().length - 1;
if (!isLastStep) {
setState(() {
currentStep += 1;
print(currentStep);
});
} else {
print("help");
}
},
onStepCancel: () {