import 'package:equatable/equatable.dart';

class LoginState extends Equatable {
  final bool rememberPassword;
  final bool isLoading;
  final String? error;
  final String? savedUsername;
  final String? savedPassword;

  const LoginState({
    this.rememberPassword = false,
    this.isLoading = false,
    this.error,
    this.savedUsername,
    this.savedPassword,
  });

  LoginState copyWith({
    bool? rememberPassword,
    bool? isLoading,
    String? error,
    String? savedUsername,
    String? savedPassword,
  }) {
    return LoginState(
      rememberPassword: rememberPassword ?? this.rememberPassword,
      isLoading: isLoading ?? this.isLoading,
      error: error,
      savedUsername: savedUsername ?? this.savedUsername,
      savedPassword: savedPassword ?? this.savedPassword,
    );
  }

  @override
  List<Object?> get props => [
        rememberPassword,
        isLoading,
        error,
        savedUsername,
        savedPassword,
      ];
}