Erweiterungen
This commit is contained in:
1 parent
c604dc9d55
commit
31fe4c5a06
20 files changed
+1804
-654
No files matched your search
+13
-12
@@ -431,24 +431,25 @@ class MqttCore {
|
||||
}
|
||||
|
||||
void _startTrackTimer() {
|
||||
_trackTimer = Timer(const Duration(seconds: 60), () {
|
||||
var position = MyApp.currentPosition;
|
||||
if (position != null) {
|
||||
var trackMessage = TrackMessage();
|
||||
trackMessage.pos = TrackPosition();
|
||||
trackMessage.pos.time = position.timestamp.toIso8601String();
|
||||
trackMessage.pos.lat = position.latitude;
|
||||
trackMessage.pos.long = position.longitude;
|
||||
trackMessage.pos.acc = position.accuracy.toInt();
|
||||
_trackTimer ??= Timer.periodic(const Duration(seconds: 60), (Timer t) {
|
||||
var position = MyApp.currentPosition;
|
||||
if (position != null) {
|
||||
var trackMessage = TrackMessage();
|
||||
trackMessage.pos = TrackPosition();
|
||||
trackMessage.pos.time = position.timestamp.toIso8601String();
|
||||
trackMessage.pos.lat = position.latitude;
|
||||
trackMessage.pos.long = position.longitude;
|
||||
trackMessage.pos.acc = position.accuracy.toInt();
|
||||
|
||||
publishPayloadMessage("track", trackMessage.toJson());
|
||||
}
|
||||
});
|
||||
publishPayloadMessage("track", trackMessage.toJson());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _cancelTrackTimer() {
|
||||
if (_trackTimer != null && _trackTimer!.isActive) {
|
||||
_trackTimer!.cancel();
|
||||
_trackTimer = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -1,3 +1,4 @@
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:audioplayers/audioplayers.dart';
|
||||
@@ -72,11 +73,11 @@ class Util {
|
||||
}
|
||||
|
||||
static logInfo(String message) {
|
||||
debugPrint(message);
|
||||
log(message);
|
||||
}
|
||||
|
||||
static logException(String message) {
|
||||
debugPrint('Exception: $message');
|
||||
log('Exception: $message');
|
||||
}
|
||||
|
||||
static int fastHash(String string) {
|
||||
|
||||
Reference in new issue
Block a user