import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';

import '../../../../model/profile/basic_information/identification_information.dart';

part 'identification_event.dart';
part 'identification_state.dart';

class IdentificationBloc extends Bloc<IdentificationEvent, IdentificationState> {
  IdentificationBloc() : super(IdentificationInitial()) {
      List<Identification> identificationInformations = [];
    on<GetIdentifications>((event, emit) {
      try{
        identificationInformations = event.identificationInformation;
        emit(IdentificationLoadedState(identificationInformation: identificationInformations));
      }catch(e){
        emit(IdenficationErrorState(message: e.toString()));
      }
    });
  }
}
