import 'package:equatable/equatable.dart';
import 'package:flutter/cupertino.dart';

abstract class SmartDoorEvent extends Equatable {
  const SmartDoorEvent();

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

class InitialEvent extends SmartDoorEvent {}

class InitialPasswordsPage extends SmartDoorEvent {}

class InitialOneTimePassword extends SmartDoorEvent {}

class InitialTimeLimitPassword extends SmartDoorEvent {}

class DoorLockUpdated extends SmartDoorEvent {}

class UpdateLockEvent extends SmartDoorEvent {
  final bool value;
  const UpdateLockEvent({required this.value});
  @override
  List<Object> get props => [value];
}

class SavePasswordEvent extends SmartDoorEvent {
  final BuildContext context;
  const SavePasswordEvent({required this.context});
  @override
  List<Object> get props => [context];
}

class GenerateAndSavePasswordTimeLimitEvent extends SmartDoorEvent {
  final BuildContext context;
  const GenerateAndSavePasswordTimeLimitEvent({required this.context});
  @override
  List<Object> get props => [context];
}

class GenerateAndSavePasswordOneTimeEvent extends SmartDoorEvent {
  final BuildContext context;
  const GenerateAndSavePasswordOneTimeEvent({required this.context});
  @override
  List<Object> get props => [context];
}

class GeneratePasswordEvent extends SmartDoorEvent {}

class SelectTimeEvent extends SmartDoorEvent {
  final BuildContext context;
  final bool isEffective;
  const SelectTimeEvent({required this.context, required this.isEffective});
  @override
  List<Object> get props => [context, isEffective];
}

class SelectTimeOnlinePasswordEvent extends SmartDoorEvent {
  final BuildContext context;
  final bool isEffective;
  const SelectTimeOnlinePasswordEvent({required this.context, required this.isEffective});
  @override
  List<Object> get props => [context, isEffective];
}

class ToggleRepeatEvent extends SmartDoorEvent {}

class SetStartEndTimeEvent extends SmartDoorEvent {
  final bool val;
  const SetStartEndTimeEvent({required this.val});
  @override
  List<Object> get props => [val];
}

class DeletePasswordEvent extends SmartDoorEvent {
  final String passwordId;

  const DeletePasswordEvent({required this.passwordId});
  @override
  List<Object> get props => [passwordId];
}

class ToggleDaySelectionEvent extends SmartDoorEvent {
  final String key;

  const ToggleDaySelectionEvent({required this.key});
  @override
  List<Object> get props => [key];
}

class ChangeTimeEvent extends SmartDoorEvent {
  final dynamic val;
  final bool isStartEndTime;

  const ChangeTimeEvent({required this.val, required this.isStartEndTime});
  @override
  List<Object> get props => [val, isStartEndTime];
}

class RenamePasswordEvent extends SmartDoorEvent {}
