Implemented settings, new scan, enhanced UI/UX
This commit is contained in:
@ -6,23 +6,11 @@ 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...
|
||||
NavigationBloc() : super(NavigationInfo(navigationIndex: 0)) {
|
||||
on<NavigateToIndex>(_navigate);
|
||||
}
|
||||
}
|
||||
|
||||
void _navigate(NavigateToIndex event, Emitter<NavigationState> emit) {
|
||||
emit(NavigationInfo(navigationIndex: event.index));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user