From 68832ff1432a575a71cc68e9b339fcdc8fba28ff Mon Sep 17 00:00:00 2001 From: Nico Date: Tue, 27 May 2025 22:50:21 +0200 Subject: [PATCH] fixed resetting of the values in spurbedingungen when editing entry or going back from map, or things like this --- .../widgets/strecke_u_spurbedingungen.dart | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/screens/excursion/widgets/strecke_u_spurbedingungen.dart b/lib/screens/excursion/widgets/strecke_u_spurbedingungen.dart index 4457dad..d99f807 100644 --- a/lib/screens/excursion/widgets/strecke_u_spurbedingungen.dart +++ b/lib/screens/excursion/widgets/strecke_u_spurbedingungen.dart @@ -42,18 +42,24 @@ class StreckeUSpurbedingungenState extends State { widget.kmFussController.addListener(onDistanceTravledUpdated); widget.kmRadController.addListener(onDistanceTravledUpdated); - widget.kmAutoController.text = "0"; - widget.kmFussController.text = "0"; - widget.kmRadController.text = "0"; + // if one of the values is "" the excursion is edited for the first time. On which value i check here is unnecessarry + if (widget.kmAutoController.text == "") { + widget.kmAutoController.text = "0"; + widget.kmFussController.text = "0"; + widget.kmRadController.text = "0"; + } // Track Conditions widget.spGutController.addListener(onTrackConditionsUpdated); widget.spMittelController.addListener(onTrackConditionsUpdated); widget.spSchlechtController.addListener(onTrackConditionsUpdated); - widget.spGutController.text = "0"; - widget.spMittelController.text = "0"; - widget.spSchlechtController.text = "0"; + // if one of the values is "" the excursion is edited for the first time. On which value i check here is unnecessarry + if (widget.spGutController.text == "") { + widget.spGutController.text = "0"; + widget.spMittelController.text = "0"; + widget.spSchlechtController.text = "0"; + } }