fix: show empty time instead of 1970 when timestamp is 0
This commit is contained in:
parent
8884bdcb40
commit
27d2841081
1 changed files with 2 additions and 2 deletions
|
|
@ -63,7 +63,7 @@ class _MainScreenState extends State<MainScreen> 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<MainScreen> 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']),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue