Erweiterungen
This commit is contained in:
1 parent
286c6537b9
commit
4526dd174f
9 files changed
+160
-93
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'chat_message.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class ChatMessage {
|
||||
late MessageContent mssg;
|
||||
|
||||
ChatMessage();
|
||||
|
||||
factory ChatMessage.fromJson(Map<String, dynamic> json) => _$ChatMessageFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ChatMessageToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class MessageContent
|
||||
{
|
||||
late String text;
|
||||
|
||||
late String subj;
|
||||
|
||||
late String time;
|
||||
|
||||
MessageContent();
|
||||
|
||||
factory MessageContent.fromJson(Map<String, dynamic> json) => _$MessageContentFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$MessageContentToJson(this);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'chat_message.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ChatMessage _$ChatMessageFromJson(Map<String, dynamic> json) => ChatMessage()
|
||||
..mssg = MessageContent.fromJson(json['mssg'] as Map<String, dynamic>);
|
||||
|
||||
Map<String, dynamic> _$ChatMessageToJson(ChatMessage instance) =>
|
||||
<String, dynamic>{
|
||||
'mssg': instance.mssg,
|
||||
};
|
||||
|
||||
MessageContent _$MessageContentFromJson(Map<String, dynamic> json) =>
|
||||
MessageContent()
|
||||
..text = json['text'] as String
|
||||
..subj = json['subj'] as String
|
||||
..time = json['time'] as String;
|
||||
|
||||
Map<String, dynamic> _$MessageContentToJson(MessageContent instance) =>
|
||||
<String, dynamic>{
|
||||
'text': instance.text,
|
||||
'subj': instance.subj,
|
||||
'time': instance.time,
|
||||
};
|
||||
@@ -3,22 +3,6 @@ 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;
|
||||
|
||||
Reference in new issue
Block a user