fix: JsonKey for User.language

This commit is contained in:
groovinchip
2021-07-21 12:28:04 -04:00
parent 25aa6f2a90
commit f109a47909
2 changed files with 2 additions and 3 deletions
@@ -86,8 +86,7 @@ class User extends Equatable {
/// The language this user prefers. /// The language this user prefers.
/// ///
/// Defaults to 'en'. /// Defaults to 'en'.
@JsonKey( @JsonKey(defaultValue: 'en')
includeIfNull: false, toJson: Serializer.readOnly, defaultValue: 'en')
final String? language; final String? language;
@override @override
@@ -48,6 +48,6 @@ Map<String, dynamic> _$UserToJson(User instance) {
writeNotNull('online', readonly(instance.online)); writeNotNull('online', readonly(instance.online));
writeNotNull('banned', readonly(instance.banned)); writeNotNull('banned', readonly(instance.banned));
val['extra_data'] = instance.extraData; val['extra_data'] = instance.extraData;
writeNotNull('language', readonly(instance.language)); val['language'] = instance.language;
return val; return val;
} }