mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-11-08 01:43:13 +00:00
31 lines
769 B
Dart
31 lines
769 B
Dart
part of 'users_cubit.dart';
|
|
|
|
class UsersState extends ServerInstallationDependendState {
|
|
const UsersState(this.users, this.rootUser, this.primaryUser);
|
|
|
|
final List<User> users;
|
|
final User rootUser;
|
|
final User primaryUser;
|
|
|
|
@override
|
|
List<Object> get props => [users, rootUser, primaryUser];
|
|
|
|
UsersState copyWith({
|
|
final List<User>? users,
|
|
final User? rootUser,
|
|
final User? primaryUser,
|
|
}) =>
|
|
UsersState(
|
|
users ?? this.users,
|
|
rootUser ?? this.rootUser,
|
|
primaryUser ?? this.primaryUser,
|
|
);
|
|
|
|
bool isLoginRegistered(final String login) =>
|
|
users.any((final User user) => user.login == login) ||
|
|
login == rootUser.login ||
|
|
login == primaryUser.login;
|
|
|
|
bool get isEmpty => users.isEmpty;
|
|
}
|