Added custom tour ordering

This commit is contained in:
Dennis Nemec
2025-12-20 21:00:33 +01:00
parent 0c61f65961
commit edb8676f5a
13 changed files with 502 additions and 166 deletions

View File

@ -56,7 +56,7 @@ class _CarManagementPageState extends State<CarManagementPage> {
return Scaffold(
body: BlocConsumer<CarsBloc, CarsState>(
listener: (context, state) {
if (state is CarsLoaded) {
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));