fixed tests
This commit is contained in:
@@ -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>))
|
||||||
|
|||||||
Reference in New Issue
Block a user