Erweiterungen

This commit is contained in:
Sven committed 2024-05-29 20:34:22 +02:00
1 parent 17e7ce6fad
commit 054dfe616e
14 files changed
+297 -189

No files matched your search

+18 -1
View File
@@ -39,9 +39,24 @@ void showInfosPopup(BuildContext context, SessionStatus? status) async {
shadowColor: Colors.transparent,
backgroundColor: Colors.white,
content: StatefulBuilder(builder: (BuildContext context, StateSetter setState) {
String getGpsStatustext() {
String gpsStatus = "nicht verfügbar";
if (MyApp.currentPosition != null) {
var nowUtc = DateTime.now().toUtc();
var minutesDelta = nowUtc.difference(MyApp.currentPosition!.timestamp);
if (minutesDelta >= const Duration(minutes: 15)) {
gpsStatus = "veraltet";
} else {
gpsStatus = "aktuell";
}
}
return gpsStatus;
}
var text = "Versionsnummer: a$version\n";
text += "Verbindungsstatus: $connectedString\n";
text += "GPS-Status: ${MyApp.currentPosition != null ? MyApp.currentPosition!.timestamp.toString() : "Unbekannt"}\n";
text += "GPS-Status: ${getGpsStatustext()}\n";
text += "\n";
text += "User Status:\n";
if (status != null) {
@@ -103,3 +118,5 @@ void showInfosPopup(BuildContext context, SessionStatus? status) async {
})));
});
}