import 'package:bloc/bloc.dart'; import 'package:equatable/equatable.dart'; import 'package:unit2/sevices/profile/references_services.dart'; import '../../model/profile/references.dart'; part 'references_event.dart'; part 'references_state.dart'; class ReferencesBloc extends Bloc { List references = []; ReferencesBloc() : super(ReferencesInitial()) { on((event, emit) async{ emit(ReferencesLoadingState()); try{ List refs = await ReferencesServices.instace.getRefences(event.profileId, event.token); references = refs; emit(ReferencesLoadedState(references: references)); }catch(e){ ReferencesErrorState(message: e.toString()); } }); } }