From 9bb9aa648869bdb14b546c41785ff6c9bdb932d3 Mon Sep 17 00:00:00 2001 From: zontreck Date: Sun, 18 May 2025 10:37:35 -0700 Subject: [PATCH] Do some minor cosmetic changes --- lib/consts.dart | 2 +- lib/data.dart | 9 +++++++++ lib/pages/HomePage.dart | 2 +- lib/pages/WorkData.dart | 11 ++++++++++- pubspec.yaml | 2 +- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/lib/consts.dart b/lib/consts.dart index d8ab2b0..02dc364 100644 --- a/lib/consts.dart +++ b/lib/consts.dart @@ -9,7 +9,7 @@ class TTConsts { static get SESSION_SERVER => "https://api.zontreck.com/timetrack/$UPDATE_CHANNEL/timetrack.php"; - static const VERSION = "1.0.0-beta.10"; + static const VERSION = "1.0.0-beta.11"; static bool UPDATE_AVAILABLE = false; static UpdateChannel UPDATE_CHANNEL = UpdateChannel.beta; diff --git a/lib/data.dart b/lib/data.dart index 196d5db..18913b9 100644 --- a/lib/data.dart +++ b/lib/data.dart @@ -42,6 +42,15 @@ class SessionData { return total; } + static int GetTotalDeliveries() { + int total = 0; + for (var trip in Trips) { + total += trip.deliveries.length; + } + + return total; + } + static String GetTotalMilesAsString() { double miles = GetTotalMiles(); if (miles == 0) return "0.0"; diff --git a/lib/pages/HomePage.dart b/lib/pages/HomePage.dart index 3f1a585..0776386 100644 --- a/lib/pages/HomePage.dart +++ b/lib/pages/HomePage.dart @@ -375,7 +375,7 @@ class _HomePageState extends State { return Column( children: [ Text( - "You are now on the clock\nYour location is being tracked for record keeping purposes.\n\nYou started ${SessionData.GetTotalTimeWorked(SessionData.StartTime, DateTime.now())}\n\n", + "You are now on the clock\nYour location is being tracked for record keeping purposes.\n\nYou started ${SessionData.GetTotalTimeWorked(SessionData.StartTime, DateTime.now())} ago\n\n", style: TextStyle(fontSize: 18), ), if (SessionData.currentTrip != null) GetTripWidgets(), diff --git a/lib/pages/WorkData.dart b/lib/pages/WorkData.dart index 1277fb7..b55a506 100644 --- a/lib/pages/WorkData.dart +++ b/lib/pages/WorkData.dart @@ -79,7 +79,7 @@ class _WorkData extends State { ), if (SessionData.TotalPay != null) Text( - "Total Pay: ${SessionData.TotalPay!}", + "Total Pay: \$${SessionData.TotalPay!}", style: TextStyle(fontSize: 18), ), @@ -91,6 +91,15 @@ class _WorkData extends State { ), SizedBox(height: 40), + Text( + "Total Number of Trips: ${SessionData.Trips.length}", + style: TextStyle(fontSize: 18), + ), + + Text( + "Total Deliveries: ${SessionData.GetTotalDeliveries()}", + style: TextStyle(fontSize: 18), + ), ElevatedButton( onPressed: () async { // Process data export to GPX format. diff --git a/pubspec.yaml b/pubspec.yaml index 4db087f..57cc5d8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.0-beta.10 +version: 1.0.0-beta.11 environment: sdk: ^3.7.2