fixed tests

This commit is contained in:
Deven Joshi
2021-11-25 17:03:17 +05:30
parent 065df414df
commit f3c0f4b494
2 changed files with 32 additions and 21 deletions
@@ -93,6 +93,7 @@ class Event {
final bool isLocal; final bool isLocal;
/// This is true if the message has been hard deleted /// This is true if the message has been hard deleted
@JsonKey(includeIfNull: false)
final bool? hardDelete; final bool? hardDelete;
/// Map of custom channel extraData /// Map of custom channel extraData
@@ -42,27 +42,37 @@ Event _$EventFromJson(Map<String, dynamic> json) => Event(
isLocal: json['is_local'] as bool? ?? false, isLocal: json['is_local'] as bool? ?? false,
); );
Map<String, dynamic> _$EventToJson(Event instance) => <String, dynamic>{ Map<String, dynamic> _$EventToJson(Event instance) {
'type': instance.type, final val = <String, dynamic>{
'cid': instance.cid, 'type': instance.type,
'channel_id': instance.channelId, 'cid': instance.cid,
'channel_type': instance.channelType, 'channel_id': instance.channelId,
'connection_id': instance.connectionId, 'channel_type': instance.channelType,
'created_at': instance.createdAt.toIso8601String(), 'connection_id': instance.connectionId,
'me': instance.me?.toJson(), 'created_at': instance.createdAt.toIso8601String(),
'user': instance.user?.toJson(), 'me': instance.me?.toJson(),
'message': instance.message?.toJson(), 'user': instance.user?.toJson(),
'channel': instance.channel?.toJson(), 'message': instance.message?.toJson(),
'member': instance.member?.toJson(), 'channel': instance.channel?.toJson(),
'reaction': instance.reaction?.toJson(), 'member': instance.member?.toJson(),
'total_unread_count': instance.totalUnreadCount, 'reaction': instance.reaction?.toJson(),
'unread_channels': instance.unreadChannels, 'total_unread_count': instance.totalUnreadCount,
'online': instance.online, 'unread_channels': instance.unreadChannels,
'parent_id': instance.parentId, 'online': instance.online,
'is_local': instance.isLocal, 'parent_id': instance.parentId,
'hard_delete': instance.hardDelete, 'is_local': instance.isLocal,
'extra_data': instance.extraData, };
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('hard_delete', instance.hardDelete);
val['extra_data'] = instance.extraData;
return val;
}
EventChannel _$EventChannelFromJson(Map<String, dynamic> json) => EventChannel( EventChannel _$EventChannelFromJson(Map<String, dynamic> json) => EventChannel(
members: (json['members'] as List<dynamic>?) members: (json['members'] as List<dynamic>?)