chore: Add language to OwnUser

This commit is contained in:
groovinchip
2021-07-22 11:08:10 -04:00
parent f109a47909
commit 4f768024c6
4 changed files with 16 additions and 1 deletions
@@ -27,6 +27,7 @@ class OwnUser extends User {
Map<String, Object?> extraData = const {},
bool banned = false,
List<String> teams = const [],
String? language,
}) : super(
id: id,
role: role,
@@ -37,6 +38,7 @@ class OwnUser extends User {
extraData: extraData,
banned: banned,
teams: teams,
language: language,
);
/// Create a new instance from a json
@@ -54,6 +56,7 @@ class OwnUser extends User {
banned: user.banned,
extraData: user.extraData,
teams: user.teams,
language: user.language,
);
/// Creates a copy of [OwnUser] with specified attributes overridden.
@@ -73,6 +76,7 @@ class OwnUser extends User {
List<Mute>? mutes,
int? totalUnreadCount,
int? unreadChannels,
String? language,
}) =>
OwnUser(
id: id ?? this.id,
@@ -89,6 +93,7 @@ class OwnUser extends User {
mutes: mutes ?? this.mutes,
totalUnreadCount: totalUnreadCount ?? this.totalUnreadCount,
unreadChannels: unreadChannels ?? this.unreadChannels,
language: language ?? this.language,
);
/// Returns a new [OwnUser] that is a combination of this ownUser
@@ -113,6 +118,7 @@ class OwnUser extends User {
totalUnreadCount: other.totalUnreadCount,
unreadChannels: other.unreadChannels,
updatedAt: other.updatedAt,
language: other.language,
);
}
@@ -37,6 +37,7 @@ class User extends Equatable {
'online',
'banned',
'teams',
'language',
];
/// User id
@@ -126,6 +127,7 @@ class User extends Equatable {
Map<String, Object?>? extraData,
bool? banned,
List<String>? teams,
String? language,
}) =>
User(
id: id ?? this.id,
@@ -137,6 +139,7 @@ class User extends Equatable {
extraData: extraData ?? this.extraData,
banned: banned ?? this.banned,
teams: teams ?? this.teams,
language: language ?? this.language,
);
@override
@@ -150,5 +153,6 @@ class User extends Equatable {
online,
banned,
extraData,
language,
];
}