diff --git a/packages/stream_chat/lib/src/models/own_user.g.dart b/packages/stream_chat/lib/src/models/own_user.g.dart index 5802060c..785efb04 100644 --- a/packages/stream_chat/lib/src/models/own_user.g.dart +++ b/packages/stream_chat/lib/src/models/own_user.g.dart @@ -23,7 +23,7 @@ OwnUser _$OwnUserFromJson(Map json) { .toList() ?? [], id: json['id'] as String, - role: json['role'] as String? ?? '', + role: json['role'] as String, createdAt: json['created_at'] == null ? null : DateTime.parse(json['created_at'] as String), diff --git a/packages/stream_chat/lib/src/models/user.dart b/packages/stream_chat/lib/src/models/user.dart index 3f4c37ef..0de3f38a 100644 --- a/packages/stream_chat/lib/src/models/user.dart +++ b/packages/stream_chat/lib/src/models/user.dart @@ -9,7 +9,7 @@ class User { /// Constructor used for json serialization User({ required this.id, - this.role = '', + this.role, DateTime? createdAt, DateTime? updatedAt, this.lastActive, @@ -41,9 +41,8 @@ class User { final String id; /// User role - @JsonKey( - includeIfNull: false, toJson: Serialization.readOnly, defaultValue: '') - final String role; + @JsonKey(includeIfNull: false, toJson: Serialization.readOnly) + final String? role; /// User role @JsonKey( diff --git a/packages/stream_chat/lib/src/models/user.g.dart b/packages/stream_chat/lib/src/models/user.g.dart index 18408d76..ef1ccf77 100644 --- a/packages/stream_chat/lib/src/models/user.g.dart +++ b/packages/stream_chat/lib/src/models/user.g.dart @@ -9,7 +9,7 @@ part of 'user.dart'; User _$UserFromJson(Map json) { return User( id: json['id'] as String, - role: json['role'] as String? ?? '', + role: json['role'] as String?, createdAt: json['created_at'] == null ? null : DateTime.parse(json['created_at'] as String),