part of 'login_bloc.dart';

enum LoginStatus { initial, loading, success, failure }

class LoginState extends Equatable {
  final LoginStatus status;
  final bool isPasswordVisible;
  final bool rememberMe;
  final String? errorMessage;
  final LoginModel? loginData;
  final bool showEmailError;
  final bool showPasswordError;

  const LoginState({
    this.status = LoginStatus.initial,
    this.isPasswordVisible = false,
    this.rememberMe = false,
    this.errorMessage,
    this.loginData,
    this.showEmailError = false,
    this.showPasswordError = false,
  });

  LoginState copyWith({
    LoginStatus? status,
    bool? isPasswordVisible,
    bool? rememberMe,
    String? errorMessage,
    LoginModel? loginData,
    bool? showEmailError,
    bool? showPasswordError,
  }) {
    return LoginState(
      status: status ?? this.status,
      isPasswordVisible: isPasswordVisible ?? this.isPasswordVisible,
      rememberMe: rememberMe ?? this.rememberMe,
      errorMessage: errorMessage ?? this.errorMessage,
      loginData: loginData ?? this.loginData,
      showEmailError: showEmailError ?? this.showEmailError,
      showPasswordError: showPasswordError ?? this.showPasswordError,
    );
  }

  @override
  List<Object?> get props => [
        status,
        isPasswordVisible,
        rememberMe,
        errorMessage,
        loginData,
        showEmailError,
        showPasswordError,
      ];
}