import 'package:equatable/equatable.dart';

/// Base class for all Personal Info events.
abstract class PersonalInfoEvent extends Equatable {
  const PersonalInfoEvent();

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

/// Event to load personal information.
class PersonalInfoLoadRequested extends PersonalInfoEvent {
  const PersonalInfoLoadRequested();
}

/// Event to update a field value.
class PersonalInfoFieldChanged extends PersonalInfoEvent {

  const PersonalInfoFieldChanged({
    required this.field,
    required this.value,
  });
  final String field;
  final dynamic value;

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

/// Event to submit the form.
class PersonalInfoFormSubmitted extends PersonalInfoEvent {
  const PersonalInfoFormSubmitted();
}

/// Event when an address is selected from autocomplete.
class PersonalInfoAddressSelected extends PersonalInfoEvent {
  const PersonalInfoAddressSelected(this.address);
  final String address;
  
  @override
  List<Object?> get props => <Object?>[address];
}
