Skip to content

Instantly share code, notes, and snippets.

@kharitonovAL
Created September 24, 2022 11:25
Show Gist options
  • Save kharitonovAL/dab9484c5745a4cee62f43db7dcdf82b to your computer and use it in GitHub Desktop.
Save kharitonovAL/dab9484c5745a4cee62f43db7dcdf82b to your computer and use it in GitHub Desktop.
Widget build(
BuildContext context,
) =>
ScreenUtilInit(
designSize: const Size(1920, 1080),
// We take MultiBlocProvider to pass multiple
// Blocs to the child MateialApp
builder: (context, widget) => MultiBlocProvider(
providers: [
BlocProvider(
create: (context) => RequestsTabCubit(),
),
BlocProvider(
create: (context) => SortingCubit(),
),
BlocProvider(
create: (context) => HousesTabCubit(),
),
BlocProvider(
create: (context) => CountersTabCubit(),
),
BlocProvider(
create: (context) => PartnersTabCubit(),
),
],
child: MaterialApp(
debugShowCheckedModeBanner: false,
theme: AppTheme.light,
home: widget,
localizationsDelegates: const [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: const [
Locale('ru', 'RU'),
],
),
),
child: FlowBuilder<AuthenticationStatus>(
// ignore: avoid_types_on_closure_parameters
state: context.select((AppBloc bloc) => bloc.state.status),
onGeneratePages: onGenerateAppViewPages,
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment