import 'package:bloc/bloc.dart';
import 'package:food_delivery_client/food_delivery_client.dart';
import 'package:freezed_annotation/freezed_annotation.dart';

part 'main_event.dart';

part 'main_state.dart';

part 'main_bloc.freezed.dart';

@injectable
class MainBloc extends Bloc<MainEvent, MainState> {
  MainBloc() : super(const MainState()) {
    on<_Loaded>((event, emit) {
      emit(state.copyWith(currentIndex: event.index));
    });
  }
}
