Erweiterungen

This commit is contained in:
Sven committed 2024-02-06 11:49:50 +01:00
1 parent dd88480f29
commit 3c2e9ceecb
14 files changed
+180 -27

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:stadtbote/protocoll_messages/fin_task_message.dart';
part 'track_message.g.dart';
/*
var payloadObject = new JObject();
var posObject = new JObject();
payloadObject.Add(new JProperty("pos", posObject));
posObject.Add(new JProperty("time", DateTime.Now.ToString("o")));
posObject.Add(new JProperty("lat", location.Latitude));
posObject.Add(new JProperty("long", location.Longitude));
if (location.Accuracy != null)
{
posObject.Add(new JProperty("acc", (int)location.Accuracy));
}
SendJsonMessageAsync("track", payloadObject);
*/
@JsonSerializable()
class TrackMessage {
late FinTaskPos pos;
TrackMessage();
factory TrackMessage.fromJson(Map<String, dynamic> json) => _$TrackMessageFromJson(json);
Map<String, dynamic> toJson() => _$TrackMessageToJson(this);
}