Added Streams to TourRepository

This commit is contained in:
Dennis Nemec
2026-01-03 01:29:21 +01:00
parent edb8676f5a
commit 9111dc92db
43 changed files with 1232 additions and 931 deletions

View File

@ -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) {