Fix the start and end time being missing
This commit is contained in:
parent
f6fcc4c390
commit
444d67cb28
7 changed files with 102 additions and 44 deletions
|
@ -1,5 +1,4 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:libacflutter/Constants.dart';
|
||||
|
@ -7,7 +6,7 @@ import 'package:timetrack/data.dart';
|
|||
import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';
|
||||
|
||||
class MapPage extends StatefulWidget {
|
||||
MapPage({super.key});
|
||||
const MapPage({super.key});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:libacflutter/Constants.dart';
|
||||
import 'package:ota_update/ota_update.dart';
|
||||
import 'package:timetrack/consts.dart';
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:libacflutter/Constants.dart';
|
||||
import 'package:timetrack/consts.dart';
|
||||
import 'package:timetrack/data.dart';
|
||||
|
||||
class WebMain extends StatefulWidget {
|
||||
const WebMain({super.key});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
return _WebMain();
|
||||
|
@ -117,6 +118,7 @@ class _WebMain extends State<WebMain> {
|
|||
),
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
SessionData.LastSessionID = sessionIDController.text;
|
||||
await SessionData.DownloadData();
|
||||
setState(() {});
|
||||
},
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:libacflutter/Constants.dart';
|
||||
import 'package:timetrack/data.dart';
|
||||
|
||||
class WorkDataPage extends StatefulWidget {
|
||||
WorkDataPage({super.key});
|
||||
const WorkDataPage({super.key});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
|
@ -50,12 +49,39 @@ class _WorkData extends State<WorkDataPage> {
|
|||
"Start Date & Time: ${SessionData.StartTime.toString()}",
|
||||
style: TextStyle(fontSize: 18),
|
||||
),
|
||||
if (SessionData.IsReadOnly)
|
||||
Text(
|
||||
"End Date & Time: ${SessionData.EndTime.toString()}",
|
||||
style: TextStyle(fontSize: 18),
|
||||
),
|
||||
|
||||
Text(
|
||||
"Total time worked: ${SessionData.GetTotalTimeWorked(SessionData.StartTime, SessionData.EndTime)}",
|
||||
style: TextStyle(fontSize: 18),
|
||||
),
|
||||
if (SessionData.StartTime.year == 0)
|
||||
ListTile(
|
||||
title: Text("ERROR"),
|
||||
subtitle: Text(
|
||||
"This TTX session file appears to have been saved in an early alpha version. It does not contain the Start time or End timestamp information.",
|
||||
),
|
||||
tileColor: LibACFlutterConstants.TITLEBAR_COLOR,
|
||||
),
|
||||
|
||||
SizedBox(height: 20),
|
||||
|
||||
Text(
|
||||
"Total Estimated Miles: ${SessionData.GetTotalMilesAsString()}\n(Note: The miles displayed above may not be 100% accurate)",
|
||||
style: TextStyle(fontSize: 24),
|
||||
),
|
||||
|
||||
SizedBox(height: 40),
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
// Process data export to GPX format.
|
||||
},
|
||||
child: Text("Export as GPX"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue