import 'package:equatable/equatable.dart';
import 'package:frontend_eccp_mobile/app/core/constants/enum/snackbar_type_enum.dart';

abstract class LoginState extends Equatable {
  const LoginState();

  @override
  List<Object?> get props => [];
}

class LoginInitial extends LoginState {}

class LoginLoading extends LoginState {}

class LoginSuccess extends LoginState {}

class LoginFailure extends LoginState {
  const LoginFailure([
    this.message,
    this.snackBarType = SnackBarType.error,
    this.duration = 2000,
  ]);

  final String? message;
  final SnackBarType snackBarType;
  final int duration;

  bool get hasMessage => message != null && message!.isNotEmpty;

  @override
  List<Object?> get props => [message, snackBarType, duration];
}
