32 lines
643 B
Dart
32 lines
643 B
Dart
import 'package:equatable/equatable.dart';
|
|
|
|
import '../../domain/entities/user_entity.dart';
|
|
|
|
/// State for users feature
|
|
class UsersState extends Equatable {
|
|
final List<UserEntity> users;
|
|
final bool isLoading;
|
|
final String? error;
|
|
|
|
const UsersState({
|
|
this.users = const [],
|
|
this.isLoading = false,
|
|
this.error,
|
|
});
|
|
|
|
UsersState copyWith({
|
|
List<UserEntity>? users,
|
|
bool? isLoading,
|
|
String? error,
|
|
}) {
|
|
return UsersState(
|
|
users: users ?? this.users,
|
|
isLoading: isLoading ?? this.isLoading,
|
|
error: error,
|
|
);
|
|
}
|
|
|
|
@override
|
|
List<Object?> get props => [users, isLoading, error];
|
|
}
|