Designed talk message reactions

This commit is contained in:
2023-07-08 21:50:25 +02:00
parent db87b7c3ff
commit 0b2fab5b6d
6 changed files with 222 additions and 171 deletions

View File

@ -1,3 +1,4 @@
import 'package:jiffy/jiffy.dart';
import 'package:json_annotation/json_annotation.dart';
import '../../../apiResponse.dart';
@ -34,6 +35,8 @@ class GetChatResponseObject {
bool isReplyable;
String referenceId;
String message;
Map<String, int>? reactions;
List<String>? reactionsSelf;
@JsonKey(fromJson: _fromJson) Map<String, RichObjectString>? messageParameters;
GetChatResponseObject(
@ -48,11 +51,35 @@ class GetChatResponseObject {
this.isReplyable,
this.referenceId,
this.message,
this.messageParameters);
this.messageParameters,
this.reactions,
this.reactionsSelf
);
factory GetChatResponseObject.fromJson(Map<String, dynamic> json) => _$GetChatResponseObjectFromJson(json);
Map<String, dynamic> toJson() => _$GetChatResponseObjectToJson(this);
static GetChatResponseObject getDateDummy(int timestamp) {
DateTime elementDate = DateTime.fromMillisecondsSinceEpoch(timestamp * 1000);
return GetChatResponseObject(
0,
"",
GetRoomResponseObjectMessageActorType.user,
"",
"",
timestamp,
elementDate.toIso8601String(),
GetRoomResponseObjectMessageType.system,
false,
"",
Jiffy.parseFromDateTime(elementDate).format(pattern: "dd.MM.yyyy"),
null,
null,
null
);
}
}
Map<String, RichObjectString>? _fromJson(json) {