Initial draft
This commit is contained in:
28
lib/widget/home/bloc/navigation_bloc.dart
Normal file
28
lib/widget/home/bloc/navigation_bloc.dart
Normal file
@ -0,0 +1,28 @@
|
||||
// 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...
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user