28 lines
728 B
Dart
28 lines
728 B
Dart
// 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(NavigateToRoute('/scan', index: 0)) {
|
|
on<NavigateToCars>((event, emit) {
|
|
emit(NavigateToRoute('/cars', index: 2));
|
|
});
|
|
|
|
on<NavigateToDeliveries>((event, emit) {
|
|
emit(NavigateToRoute('/deliveries', index: 1));
|
|
});
|
|
|
|
on<NavigateToDelivery>((event, emit) {
|
|
emit(NavigateToRoute('/delivery'));
|
|
});
|
|
|
|
on<NavigateToScan>((event, emit) {
|
|
emit(NavigateToRoute('/scan', index: 0));
|
|
});
|
|
|
|
// Add more navigation handlers...
|
|
}
|
|
} |