33 lines
1.1 KiB
Dart
33 lines
1.1 KiB
Dart
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);
|
|
}
|
|
|