2025-10-29 16:13:10 +05:30
import ' package:citycards_customer/cart/blocs/postcard_bloc.dart ' ;
2025-10-29 19:59:49 +05:30
import ' package:citycards_customer/core/route_constants.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
2025-10-14 15:47:16 +05:30
import ' core/app_router.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-01-23 19:00:55 +05:30
import ' login/bloc/login/login_bloc.dart ' ;
import ' login/repository/login_repository.dart ' ;
2025-10-29 16:13:10 +05:30
import ' my_pass/blocs/my_pass_bloc.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 ( ) ;
2025-10-29 16:13:10 +05:30
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 (
designSize: const Size ( 390 , 844 ) ,
builder: ( context , child ) {
2025-10-29 16:13:10 +05:30
return MultiBlocProvider (
providers: [
BlocProvider < MyPassBloc > (
create: ( _ ) = > MyPassBloc ( ) . . add ( LoadMyPasses ( ) ) ,
) ,
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 ( ) ,
) ,
) ,
2025-10-29 16:13:10 +05:30
] ,
child: MaterialApp (
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
}