import 'package:bloc/bloc.dart'; import 'package:equatable/equatable.dart'; import 'package:unit2/sevices/profile/learningDevelopment_service.dart'; import '../../model/profile/learning_development.dart'; part 'learning_development_event.dart'; part 'learning_development_state.dart'; class LearningDevelopmentBloc extends Bloc { LearningDevelopmentBloc() : super(LearningDevelopmentInitial()) { List learningsAndDevelopments; on((event, emit) async { // try { emit(LearningDevelopmentLoadingState()); List learnings = await LearningDevelopmentServices .instance .getLearningDevelopments(event.profileId, event.token); learningsAndDevelopments = learnings; emit(LearningDevelopmentLoadedState( learningsAndDevelopment: learningsAndDevelopments)); // } catch (e) { // emit(LeaningDevelopmentErrorState(message: e.toString())); // } }); } }