2026-02-26 10:20:34 +05:30
import ' package:citycards_customer/cart/blocs/myPostcardsCart/my_postcards_cart_bloc.dart ' ;
2025-10-29 16:13:10 +05:30
import ' package:citycards_customer/cart/blocs/postcard_bloc.dart ' ;
2026-02-13 15:27:14 +05:30
import ' package:citycards_customer/cart/repository/my_pass_cart_repository.dart ' ;
2025-10-29 19:59:49 +05:30
import ' package:citycards_customer/core/route_constants.dart ' ;
2026-02-20 18:50:28 +05:30
import ' package:citycards_customer/postcard/blocs/postcard_creation_bloc.dart ' ;
2026-01-29 19:32:11 +05:30
import ' package:citycards_customer/search_offers/bloc/offers_bloc.dart ' ;
2025-11-07 17:44:51 +05:30
import ' package:citycards_customer/trail.dart ' ;
2025-10-13 17:55:07 +05:30
import ' package:flutter/material.dart ' ;
import ' package:flutter/services.dart ' ;
2025-10-29 16:13:10 +05:30
import ' package:flutter_bloc/flutter_bloc.dart ' ;
2025-10-15 12:21:55 +05:30
import ' package:flutter_screenutil/flutter_screenutil.dart ' ;
2025-10-13 17:55:07 +05:30
import ' package:google_fonts/google_fonts.dart ' ;
2026-01-30 19:27:06 +05:30
import ' package:flutter_stripe/flutter_stripe.dart ' ; // ADD THIS
2026-02-13 15:27:14 +05:30
import ' cart/blocs/myPassCart/my_pass_cart_bloc.dart ' ;
2026-02-26 10:20:34 +05:30
import ' common_bloc/bottom_navigation_bloc.dart ' ;
2025-10-14 15:47:16 +05:30
import ' core/app_router.dart ' ;
2026-02-13 18:34:00 +05:30
import ' core/global_keys.dart ' ;
2026-01-16 19:18:42 +05:30
import ' home/bloc/FirstTimeUserHome/first_time_user_home_bloc.dart ' ;
import ' home/bloc/FirstTimeUserHome/first_time_user_home_event.dart ' ;
2026-01-19 19:10:14 +05:30
import ' home/bloc/registeredHome/home_bloc.dart ' ;
2026-01-16 19:18:42 +05:30
import ' home/repository/first_time_user_home_repository.dart ' ;
2026-01-19 19:10:14 +05:30
import ' home/repository/home_repository.dart ' ;
2026-03-05 19:02:22 +05:30
import ' itinerary_creation/bloc/createItinerary/create_itinerary_bloc.dart ' ;
2026-02-10 10:44:19 +05:30
import ' itinerary_creation/bloc/get_itinerary_bloc.dart ' ;
import ' itinerary_creation/views/magic_itinerary_view.dart ' ;
2026-01-23 19:00:55 +05:30
import ' login/bloc/login/login_bloc.dart ' ;
import ' login/repository/login_repository.dart ' ;
2026-02-13 15:27:14 +05:30
import ' my_pass/blocs/myPasses/my_passes_bloc.dart ' ;
2025-10-29 16:13:10 +05:30
import ' my_pass/blocs/my_pass_bloc.dart ' ;
2026-02-13 15:27:14 +05:30
import ' my_pass/repository/my_passes_repository.dart ' ;
2026-02-05 12:07:33 +05:30
import ' postcard/blocs/myPostCards/my_postcard_bloc.dart ' ;
import ' postcard/repository/my_postcard_repository.dart ' ;
2026-01-28 19:28:37 +05:30
import ' profile/bloc/profile/profile_bloc.dart ' ;
2026-01-29 19:32:11 +05:30
import ' search_offers/repository/offers_repository.dart ' ;
import ' search_offers/view/search_offers_with_listing.dart ' ;
2025-10-14 11:20:25 +05:30
2026-01-30 19:27:06 +05:30
void main ( ) async { // CHANGE: Add async
2025-10-13 17:55:07 +05:30
WidgetsFlutterBinding . ensureInitialized ( ) ;
2026-03-25 17:59:22 +05:30
await SystemChrome . setPreferredOrientations ( [
DeviceOrientation . portraitUp ,
// DeviceOrientation.portraitDown, // optional (allows upside-down)
] ) ;
2026-01-30 19:27:06 +05:30
Stripe . publishableKey = ' pk_test_51SrwZ7RtCkWyT4EmmP5ozlEVEscMvWPDPVshQbNdQe1S27iGkwZ7YD4BSEm7TUvvlgPRvznuQq6daVyA9p1UWNnz00WVsaw2Yj ' ; // Replace with your key
// Stripe.merchantIdentifier = 'merchant.com.citycards'; // Optional
// Stripe.urlScheme = 'flutterstripe'; // Optional
2025-10-15 12:21:55 +05:30
SystemChrome . setSystemUIOverlayStyle (
const SystemUiOverlayStyle (
statusBarColor: Colors . white ,
statusBarIconBrightness: Brightness . dark ,
statusBarBrightness: Brightness . light ,
) ,
) ;
2025-10-29 16:13:10 +05:30
2025-10-14 15:47:16 +05:30
runApp ( MyApp ( ) ) ;
2025-10-13 17:55:07 +05:30
}
class MyApp extends StatelessWidget {
2025-10-15 12:21:55 +05:30
MyApp ( { super . key } ) ;
2025-10-14 15:47:16 +05:30
final AppRouter _appRouter = AppRouter ( ) ;
2025-10-13 17:55:07 +05:30
@ override
Widget build ( BuildContext context ) {
2025-10-15 12:21:55 +05:30
return ScreenUtilInit (
2026-02-20 18:50:28 +05:30
designSize: const Size ( 360 , 844 ) ,
2025-10-15 12:21:55 +05:30
builder: ( context , child ) {
2025-10-29 16:13:10 +05:30
return MultiBlocProvider (
providers: [
BlocProvider < MyPassBloc > (
create: ( _ ) = > MyPassBloc ( ) . . add ( LoadMyPasses ( ) ) ,
) ,
2026-02-20 18:50:28 +05:30
BlocProvider (
create: ( context ) = > PostcardCreationBloc ( ) ,
) ,
2026-02-26 10:20:34 +05:30
BlocProvider < NavigationBloc > (
create: ( _ ) = > NavigationBloc ( ) ,
) ,
2026-02-13 15:27:14 +05:30
BlocProvider < MyPassesBloc > (
create: ( _ ) = > MyPassesBloc ( MyPassesRepository ( ) ) ,
) ,
BlocProvider < MyPassCartBloc > (
create: ( _ ) = > MyPassCartBloc ( repository: MyPassCartRepository ( ) ) ,
) ,
2026-02-26 10:20:34 +05:30
BlocProvider < MyPostCardsCartBloc > (
create: ( _ ) = > MyPostCardsCartBloc ( ) ,
) ,
2026-01-16 19:18:42 +05:30
BlocProvider < FirstTimeUserHomeBloc > (
create: ( context ) = > FirstTimeUserHomeBloc (
FirstTimeUserHomeRepository ( ) ,
) . . add ( FetchFirstTimeUserHomeEvent ( ) ) ,
) ,
2026-01-19 19:10:14 +05:30
BlocProvider (
create: ( context ) = > HomeBloc (
homeRepository: HomeRepository ( ) ,
) ,
) ,
2026-01-23 19:00:55 +05:30
BlocProvider (
create: ( context ) = > LoginBloc (
loginRepository: LoginRepository ( ) ,
) ,
) ,
2026-01-30 19:27:06 +05:30
BlocProvider (
create: ( _ ) = > OffersBloc ( OffersRepository ( ) ) ,
child: const OffersScreen ( ) ,
) ,
BlocProvider ( create: ( context ) = > ProfileBloc ( ) ) ,
2026-02-05 12:07:33 +05:30
BlocProvider < MyPostCardBloc > (
create: ( context ) = > MyPostCardBloc (
repository: MyPostCardsRepository ( ) ,
) ,
) ,
2026-02-10 10:44:19 +05:30
BlocProvider (
create: ( context ) = > GetItineraryBloc ( ) ,
child: MagicItineraryView ( ) ,
2026-03-05 19:02:22 +05:30
) ,
BlocProvider (
create: ( context ) = > CreateItineraryBloc ( ) ,
) ,
2025-10-29 16:13:10 +05:30
] ,
child: MaterialApp (
2026-02-13 18:34:00 +05:30
scaffoldMessengerKey: GlobalKeys . scaffoldMessengerKey ,
2025-10-29 16:13:10 +05:30
onGenerateRoute: _appRouter . onGenerateRoute ,
2025-11-10 12:38:50 +05:30
initialRoute: RouteConstants . splash ,
2025-10-29 16:13:10 +05:30
debugShowCheckedModeBanner: false ,
title: ' City Cards ' ,
theme: ThemeData (
textTheme: GoogleFonts . poppinsTextTheme (
Theme . of ( context ) . textTheme ,
) ,
2025-10-15 12:21:55 +05:30
) ,
) ,
) ;
} ,
2025-10-13 17:55:07 +05:30
) ;
}
2026-01-30 19:27:06 +05:30
}