// Navigation events
import 'package:flutter_bloc/flutter_bloc.dart';

import 'navigation_event.dart';
import 'navigation_state.dart';

// Navigation BLoC
class NavigationBloc extends Bloc<NavigationEvent, NavigationState> {
  NavigationBloc() : super(NavigationInfo(navigationIndex: 0)) {
    on<NavigateToIndex>(_navigate);
  }

  void _navigate(NavigateToIndex event, Emitter<NavigationState> emit) {
    emit(NavigationInfo(navigationIndex: event.index));
  }
}
