import 'package:bloc/bloc.dart'; import 'package:equatable/equatable.dart'; import 'package:unit2/sevices/skillshobbies_services.dart'; import '../../model/profile/other_information/skills_and_hobbies.dart'; part 'hoobies_event.dart'; part 'hoobies_state.dart'; class HoobiesBloc extends Bloc { HoobiesBloc() : super(HoobiesInitial()) { List skillsAndHobbies = []; on((event, emit)async { emit(HobbiesLoadingState()); try{ List hobbies = await SkillsHobbiesServices.instance.getSkillsHobbies(event.profileId, event.token); skillsAndHobbies = hobbies; emit(HobbiesLoadedState(skillsAndHobbies: skillsAndHobbies)); }catch(e){ emit(HobbiesErrorState(message: e.toString())); } }); } }