chore(llc): re-generate model classes
Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
@@ -110,6 +110,6 @@ Map<String, dynamic> _$MessageToJson(Message instance) {
|
|||||||
val['pinned_by'] = readonly(instance.pinnedBy);
|
val['pinned_by'] = readonly(instance.pinnedBy);
|
||||||
val['extra_data'] = instance.extraData;
|
val['extra_data'] = instance.extraData;
|
||||||
writeNotNull('deleted_at', readonly(instance.deletedAt));
|
writeNotNull('deleted_at', readonly(instance.deletedAt));
|
||||||
val['i18n'] = instance.i18n;
|
writeNotNull('i18n', readonly(instance.i18n));
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class OwnUser extends User {
|
|||||||
Map<String, Object?> extraData = const {},
|
Map<String, Object?> extraData = const {},
|
||||||
bool banned = false,
|
bool banned = false,
|
||||||
List<String> teams = const [],
|
List<String> teams = const [],
|
||||||
String? language,
|
String language = 'en',
|
||||||
}) : super(
|
}) : super(
|
||||||
id: id,
|
id: id,
|
||||||
role: role,
|
role: role,
|
||||||
@@ -99,10 +99,7 @@ class OwnUser extends User {
|
|||||||
/// Returns a new [OwnUser] that is a combination of this ownUser
|
/// Returns a new [OwnUser] that is a combination of this ownUser
|
||||||
/// and the given [other] ownUser.
|
/// and the given [other] ownUser.
|
||||||
OwnUser merge(OwnUser? other) {
|
OwnUser merge(OwnUser? other) {
|
||||||
if (other == null) {
|
if (other == null) return this;
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
return copyWith(
|
return copyWith(
|
||||||
banned: other.banned,
|
banned: other.banned,
|
||||||
channelMutes: other.channelMutes,
|
channelMutes: other.channelMutes,
|
||||||
|
|||||||
@@ -39,5 +39,6 @@ OwnUser _$OwnUserFromJson(Map<String, dynamic> json) {
|
|||||||
teams:
|
teams:
|
||||||
(json['teams'] as List<dynamic>?)?.map((e) => e as String).toList() ??
|
(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'.
|
/// Defaults to 'en'.
|
||||||
@JsonKey(defaultValue: 'en')
|
@JsonKey(defaultValue: 'en')
|
||||||
final String? language;
|
final String language;
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode => id.hashCode;
|
|
||||||
|
|
||||||
/// Shortcut for user name
|
/// Shortcut for user name
|
||||||
String get name {
|
String get name {
|
||||||
@@ -106,11 +103,6 @@ class User extends Equatable {
|
|||||||
static List<String>? toIds(List<User>? users) =>
|
static List<String>? toIds(List<User>? users) =>
|
||||||
users?.map((u) => u.id).toList();
|
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
|
/// Serialize to json
|
||||||
Map<String, dynamic> toJson() => Serializer.moveFromExtraDataToRoot(
|
Map<String, dynamic> toJson() => Serializer.moveFromExtraDataToRoot(
|
||||||
_$UserToJson(this),
|
_$UserToJson(this),
|
||||||
@@ -143,16 +135,5 @@ class User extends Equatable {
|
|||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object?> get props => [
|
List<Object?> get props => [id];
|
||||||
id,
|
|
||||||
role,
|
|
||||||
teams,
|
|
||||||
createdAt,
|
|
||||||
updatedAt,
|
|
||||||
lastActive,
|
|
||||||
online,
|
|
||||||
banned,
|
|
||||||
extraData,
|
|
||||||
language,
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user