fixed tests, null errors

This commit is contained in:
Deven Joshi
2021-04-12 18:44:30 +05:30
parent 686dcf27e6
commit 9ec4c83cfc
18 changed files with 124 additions and 106 deletions
@@ -87,7 +87,7 @@ class AttachmentFile {
final int? size;
/// File extension for this file.
String? get extension => name?.split('.')?.last;
String? get extension => name?.split('.').last;
/// Serialize to json
Map<String, dynamic> toJson() => _$AttachmentFileToJson(this);
@@ -43,8 +43,8 @@ class ChannelState {
final List<Read>? read;
/// Create a new instance from a json
static ChannelState fromJson(Map<String, dynamic>? json) =>
_$ChannelStateFromJson(json!);
static ChannelState fromJson(Map<String, dynamic> json) =>
_$ChannelStateFromJson(json);
/// Serialize to json
Map<String, dynamic> toJson() => _$ChannelStateToJson(this);
@@ -11,7 +11,7 @@ class Serialization {
/// List of users to list of userIds
static List<String?>? userIds(List<User>? users) =>
users?.map((u) => u.id)?.toList();
users?.map((u) => u.id).toList();
/// Takes unknown json keys and puts them in the `extra_data` key
static Map<String, dynamic>? moveToExtraDataFromRoot(