import 'package:eatvio_app/features/calendar/presentation/bloc/calendar_state.dart'; import 'package:eatvio_app/features/calendar/repositories/calendar_repository.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class CalendarCubit extends Cubit { final CalendarRepository calendarRepository; CalendarCubit({required this.calendarRepository}) : super(const CalendarState.loading()); loadCalendarList() async { emit(const CalendarState.loading()); try { final calendarList = await calendarRepository.getCalendar(); emit(CalendarState.loaded(calendarList: calendarList)); } catch (e) { emit(CalendarState.error(errorMessage: e.toString())); } } }