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,7 +42,8 @@ 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) {
final val = <String, dynamic>{
'type': instance.type, 'type': instance.type,
'cid': instance.cid, 'cid': instance.cid,
'channel_id': instance.channelId, 'channel_id': instance.channelId,
@@ -60,10 +61,19 @@ Map<String, dynamic> _$EventToJson(Event instance) => <String, dynamic>{
'online': instance.online, 'online': instance.online,
'parent_id': instance.parentId, 'parent_id': instance.parentId,
'is_local': instance.isLocal, 'is_local': instance.isLocal,
'hard_delete': instance.hardDelete,
'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>?)
?.map((e) => Member.fromJson(e as Map<String, dynamic>)) ?.map((e) => Member.fromJson(e as Map<String, dynamic>))