From 6bedd04a57338477062ad984286822e04dff1ad7 Mon Sep 17 00:00:00 2001 From: Helldragon67 Date: Fri, 7 Feb 2025 14:44:18 +0100 Subject: [PATCH 1/3] removed rounding --- frontend/lib/modules/step_between_landmarks.dart | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/lib/modules/step_between_landmarks.dart b/frontend/lib/modules/step_between_landmarks.dart index 58fa106..b238cc1 100644 --- a/frontend/lib/modules/step_between_landmarks.dart +++ b/frontend/lib/modules/step_between_landmarks.dart @@ -19,8 +19,7 @@ class StepBetweenLandmarks extends StatefulWidget { class _StepBetweenLandmarksState extends State { @override Widget build(BuildContext context) { - int timeRounded = 5 * ((widget.current.tripTime?.inMinutes ?? 0) ~/ 5); - // ~/ is integer division (rounding) + int time = widget.current.tripTime?.inMinutes ?? 0; return Container( margin: EdgeInsets.all(10), padding: EdgeInsets.all(10), @@ -34,7 +33,7 @@ class _StepBetweenLandmarksState extends State { Column( children: [ Icon(Icons.directions_walk), - Text("~$timeRounded min", style: TextStyle(fontSize: 10)), + Text("$time min", style: TextStyle(fontSize: 10)), ], ), Spacer(), From 4fd1272ea4690864c2c49efc3bb86a50d908d344 Mon Sep 17 00:00:00 2001 From: Helldragon67 Date: Fri, 7 Feb 2025 15:08:00 +0100 Subject: [PATCH 2/3] test --- frontend/lib/modules/step_between_landmarks.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/lib/modules/step_between_landmarks.dart b/frontend/lib/modules/step_between_landmarks.dart index b238cc1..487b343 100644 --- a/frontend/lib/modules/step_between_landmarks.dart +++ b/frontend/lib/modules/step_between_landmarks.dart @@ -19,7 +19,7 @@ class StepBetweenLandmarks extends StatefulWidget { class _StepBetweenLandmarksState extends State { @override Widget build(BuildContext context) { - int time = widget.current.tripTime?.inMinutes ?? 0; + int time = 5 * ((widget.current.tripTime?.inMinutes ?? 0) ~/ 5); return Container( margin: EdgeInsets.all(10), padding: EdgeInsets.all(10), From 0271c3d7a7caebd5374c08610720fe2f96d5eb7a Mon Sep 17 00:00:00 2001 From: Helldragon67 Date: Fri, 7 Feb 2025 15:14:21 +0100 Subject: [PATCH 3/3] removed rounding but app won't compile --- frontend/lib/modules/step_between_landmarks.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/lib/modules/step_between_landmarks.dart b/frontend/lib/modules/step_between_landmarks.dart index 487b343..b238cc1 100644 --- a/frontend/lib/modules/step_between_landmarks.dart +++ b/frontend/lib/modules/step_between_landmarks.dart @@ -19,7 +19,7 @@ class StepBetweenLandmarks extends StatefulWidget { class _StepBetweenLandmarksState extends State { @override Widget build(BuildContext context) { - int time = 5 * ((widget.current.tripTime?.inMinutes ?? 0) ~/ 5); + int time = widget.current.tripTime?.inMinutes ?? 0; return Container( margin: EdgeInsets.all(10), padding: EdgeInsets.all(10),