168 lines
5.6 KiB
Dart
168 lines
5.6 KiB
Dart
import 'package:citycards_customer/Profile/profile_page_view.dart';
|
|
import 'package:citycards_customer/add_details/add_details_view.dart';
|
|
import 'package:citycards_customer/attraction_details/attraction_details_view.dart';
|
|
import 'package:citycards_customer/buy_a_pass/view/buy_pass_view.dart';
|
|
import 'package:citycards_customer/checkout/view/checkout_view.dart';
|
|
import 'package:citycards_customer/common_bloc/language_selection_bloc.dart';
|
|
import 'package:citycards_customer/contact_us/contact_us_view.dart';
|
|
import 'package:citycards_customer/create_account/create_account_view.dart';
|
|
import 'package:citycards_customer/edit_profile/edit_profile_view.dart';
|
|
import 'package:citycards_customer/esim_offer/esim_offer_view.dart';
|
|
import 'package:citycards_customer/faq/faq_view.dart';
|
|
import 'package:citycards_customer/hotel_offer/hotel_offer_view.dart';
|
|
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_detail_bloc.dart';
|
|
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_steps_selection_bloc.dart';
|
|
import 'package:citycards_customer/itinerary_creation/views/itinerary_creation_start_view.dart';
|
|
import 'package:citycards_customer/itinerary_creation/views/itinerary_creation_view.dart';
|
|
import 'package:citycards_customer/privacy/privacy_view.dart';
|
|
import 'package:citycards_customer/search_offers/bloc/search_offers_listing_bloc.dart';
|
|
import 'package:citycards_customer/search_offers/view/search_offers_with_listing.dart';
|
|
import 'package:citycards_customer/terms_and_condition/terms_and_condition_view.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import '../attractions/views/attractions_page_view.dart';
|
|
import '../cart/views/my_cart_view_page.dart';
|
|
import '../common_bloc/bottom_navigation_bloc.dart';
|
|
import '../home/views/home_page_view.dart';
|
|
import 'route_constants.dart';
|
|
|
|
class AppRouter {
|
|
Route onGenerateRoute(RouteSettings settings) {
|
|
switch (settings.name) {
|
|
case '/':
|
|
case RouteConstants.home:
|
|
return MaterialPageRoute(
|
|
builder: (_) {
|
|
return BlocProvider(
|
|
create: (_) => NavigationBloc(),
|
|
child: const HomePage(),
|
|
);
|
|
},
|
|
);
|
|
case RouteConstants.attractionsPage:
|
|
return MaterialPageRoute(builder: (_) => const AttractionsPage());
|
|
case RouteConstants.profile:
|
|
return MaterialPageRoute(
|
|
builder: (_) {
|
|
return BlocProvider(
|
|
create: (_) => LanguageBloc(),
|
|
child: const ProfilePage(),
|
|
);
|
|
},
|
|
);
|
|
case RouteConstants.editProfile:
|
|
return MaterialPageRoute(
|
|
builder: (_) {
|
|
return const EditProfilePage();
|
|
},
|
|
);
|
|
case RouteConstants.contactUs:
|
|
return MaterialPageRoute(
|
|
builder: (_) {
|
|
return const ContactUsPage();
|
|
},
|
|
);
|
|
case RouteConstants.faq:
|
|
return MaterialPageRoute(
|
|
builder: (_) {
|
|
return const FaqPage();
|
|
},
|
|
);
|
|
case RouteConstants.termsAndCondition:
|
|
return MaterialPageRoute(
|
|
builder: (_) {
|
|
return const TermsAndCondition();
|
|
},
|
|
);
|
|
case RouteConstants.privacyPolicy:
|
|
return MaterialPageRoute(
|
|
builder: (_) {
|
|
return const PrivacyPolicyPage();
|
|
},
|
|
);
|
|
|
|
case RouteConstants.itineraryCreationStart:
|
|
return MaterialPageRoute(
|
|
builder: (_) {
|
|
return ItineraryCreationStartPage();
|
|
},
|
|
);
|
|
|
|
case RouteConstants.itineraryCreation:
|
|
return MaterialPageRoute(
|
|
builder: (_) {
|
|
return MultiBlocProvider(
|
|
providers: [
|
|
BlocProvider<ItineraryStepNavigationBloc>(
|
|
create: (_) => ItineraryStepNavigationBloc(),
|
|
),
|
|
|
|
BlocProvider<AddItineraryDetailBloc>(
|
|
create: (_) => AddItineraryDetailBloc(),
|
|
),
|
|
],
|
|
child: const ItineraryCreationPage(),
|
|
);
|
|
},
|
|
);
|
|
|
|
case RouteConstants.hotelOffer:
|
|
return MaterialPageRoute(
|
|
builder: (_) {
|
|
return HotelOfferView();
|
|
},
|
|
);
|
|
|
|
case RouteConstants.esimOffer:
|
|
return MaterialPageRoute(
|
|
builder: (_) {
|
|
return EsimOfferPage();
|
|
},
|
|
);
|
|
|
|
case RouteConstants.attractionDetails:
|
|
return MaterialPageRoute(builder: (_) {
|
|
return AttractionDetailsView();
|
|
});
|
|
|
|
case RouteConstants.buyPass:
|
|
return MaterialPageRoute(builder: (_) {
|
|
return BuyPassView();
|
|
});
|
|
|
|
case RouteConstants.checkout:
|
|
return MaterialPageRoute(builder: (_){
|
|
return CheckoutView();
|
|
});
|
|
|
|
case RouteConstants.cartPage:
|
|
return MaterialPageRoute(builder: (_){
|
|
return MyCartPage();
|
|
});
|
|
|
|
case RouteConstants.searchOffer:
|
|
return MaterialPageRoute(builder: (_){
|
|
return BlocProvider(
|
|
create: (_) => OffersBloc(),
|
|
child: SearchOffersWithListing(),
|
|
);
|
|
});
|
|
|
|
case RouteConstants.addDetails:
|
|
return MaterialPageRoute(builder: (_){
|
|
return AddDetailsView();
|
|
});
|
|
|
|
case RouteConstants.createAcct:
|
|
return MaterialPageRoute(builder: (_){
|
|
return CreateAccountView();
|
|
});
|
|
default:
|
|
return MaterialPageRoute(
|
|
builder: (_) =>
|
|
const Scaffold(body: Center(child: Text('404 - Page Not Found'))),
|
|
);
|
|
}
|
|
}
|
|
}
|