chore(llc): re-generate model classes

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2021-07-27 16:47:24 +05:30
committed by xsahil03x
parent 6329c1e9a8
commit c5782e0275
4 changed files with 6 additions and 27 deletions
@@ -110,6 +110,6 @@ Map<String, dynamic> _$MessageToJson(Message instance) {
val['pinned_by'] = readonly(instance.pinnedBy);
val['extra_data'] = instance.extraData;
writeNotNull('deleted_at', readonly(instance.deletedAt));
val['i18n'] = instance.i18n;
writeNotNull('i18n', readonly(instance.i18n));
return val;
}
@@ -27,7 +27,7 @@ class OwnUser extends User {
Map<String, Object?> extraData = const {},
bool banned = false,
List<String> teams = const [],
String? language,
String language = 'en',
}) : super(
id: id,
role: role,
@@ -99,10 +99,7 @@ class OwnUser extends User {
/// Returns a new [OwnUser] that is a combination of this ownUser
/// and the given [other] ownUser.
OwnUser merge(OwnUser? other) {
if (other == null) {
return this;
}
if (other == null) return this;
return copyWith(
banned: other.banned,
channelMutes: other.channelMutes,
@@ -39,5 +39,6 @@ OwnUser _$OwnUserFromJson(Map<String, dynamic> json) {
teams:
(json['teams'] as List<dynamic>?)?.map((e) => e as String).toList() ??
[],
language: json['language'] as String? ?? 'en',
);
}
@@ -88,10 +88,7 @@ class User extends Equatable {
///
/// Defaults to 'en'.
@JsonKey(defaultValue: 'en')
final String? language;
@override
int get hashCode => id.hashCode;
final String language;
/// Shortcut for user name
String get name {
@@ -106,11 +103,6 @@ class User extends Equatable {
static List<String>? toIds(List<User>? users) =>
users?.map((u) => u.id).toList();
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is User && runtimeType == other.runtimeType && id == other.id;
/// Serialize to json
Map<String, dynamic> toJson() => Serializer.moveFromExtraDataToRoot(
_$UserToJson(this),
@@ -143,16 +135,5 @@ class User extends Equatable {
);
@override
List<Object?> get props => [
id,
role,
teams,
createdAt,
updatedAt,
lastActive,
online,
banned,
extraData,
language,
];
List<Object?> get props => [id];
}