From 27d2841081a7de01df442c047ec767e7eb2f5ac6 Mon Sep 17 00:00:00 2001 From: fiatcode Date: Sat, 2 May 2026 17:34:39 +0700 Subject: [PATCH] fix: show empty time instead of 1970 when timestamp is 0 --- lib/main_screen.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/main_screen.dart b/lib/main_screen.dart index b0ef7ed..c014752 100644 --- a/lib/main_screen.dart +++ b/lib/main_screen.dart @@ -63,7 +63,7 @@ class _MainScreenState extends State with TickerProviderStateMixin { _lastSpeed = (speed * 3.6).toStringAsFixed(1); } final timestamp = status?['lastTimestamp']; - if (timestamp != null) { + if (timestamp != null && timestamp > 0) { _lastTime = _formatDateTime( DateTime.fromMillisecondsSinceEpoch(timestamp), ); @@ -79,7 +79,7 @@ class _MainScreenState extends State with TickerProviderStateMixin { _lastSpeed = location['speed'] != null ? (location['speed'] * 3.6).toStringAsFixed(1) : '--'; - _lastTime = location['timestamp'] != null + _lastTime = location['timestamp'] != null && location['timestamp'] > 0 ? _formatDateTime( DateTime.fromMillisecondsSinceEpoch(location['timestamp']), )