Added Streams to TourRepository
This commit is contained in:
@ -56,10 +56,14 @@ class _CarManagementPageState extends State<CarManagementPage> {
|
||||
return Scaffold(
|
||||
body: BlocConsumer<CarsBloc, CarsState>(
|
||||
listener: (context, state) {
|
||||
if (state is CarsLoaded && context.read<TourBloc>().state is TourLoaded) {
|
||||
var tour = (context.read<TourBloc>().state as TourLoaded).tour.copyWith();
|
||||
if (state is CarsLoaded &&
|
||||
context.read<TourBloc>().state is TourLoaded) {
|
||||
var tour =
|
||||
(context.read<TourBloc>().state as TourLoaded).tour.copyWith();
|
||||
tour.driver.cars = state.cars;
|
||||
context.read<TourBloc>().add(UpdateTour(tour: tour));
|
||||
context.read<TourBloc>().add(
|
||||
TourUpdated(tour: tour, payments: tour.paymentMethods),
|
||||
);
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
|
||||
Reference in New Issue
Block a user