and so on
This commit is contained in:
@@ -12,6 +12,7 @@ import 'package:maibu_satabot_v2/core/app/app_user_cubit.dart';
|
||||
import 'package:maibu_satabot_v2/core/infrastructure/logging/app_bloc_observer.dart';
|
||||
import 'package:maibu_satabot_v2/core/logging/i_logger_service.dart';
|
||||
import 'package:maibu_satabot_v2/core/theme/AppTheme.dart';
|
||||
import 'package:maibu_satabot_v2/core/theme/theme_cubit.dart';
|
||||
import 'package:maibu_satabot_v2/core/update/update_cubit.dart';
|
||||
import 'package:maibu_satabot_v2/core/update/version_check_service.dart';
|
||||
import 'package:maibu_satabot_v2/core/update/update_dialog.dart';
|
||||
@@ -71,6 +72,7 @@ class MyApp extends StatelessWidget {
|
||||
sl<AuthCubit>().appStarted();
|
||||
final deviceStatusBloc = sl<DeviceStatusBloc>();
|
||||
final localeCubit = sl<LocaleCubit>();
|
||||
final themeCubit = sl<ThemeCubit>();
|
||||
|
||||
return MultiBlocProvider(
|
||||
providers: [
|
||||
@@ -98,6 +100,7 @@ class MyApp extends StatelessWidget {
|
||||
),
|
||||
BlocProvider<DeviceStatusBloc>.value(value: deviceStatusBloc),
|
||||
BlocProvider<LocaleCubit>.value(value: localeCubit),
|
||||
BlocProvider<ThemeCubit>.value(value: themeCubit),
|
||||
BlocProvider<TabConfigCubit>.value(value: sl<TabConfigCubit>()),
|
||||
BlocProvider<PermissionRequestBloc>(
|
||||
create: (_) => sl<PermissionRequestBloc>(),
|
||||
@@ -113,20 +116,27 @@ class MyApp extends StatelessWidget {
|
||||
child: BlocBuilder<LocaleCubit, Locale>(
|
||||
bloc: localeCubit,
|
||||
builder: (context, locale) {
|
||||
return MaterialApp.router(
|
||||
title: 'Maibu Satabot',
|
||||
locale: locale,
|
||||
supportedLocales: const [Locale('zh', 'CN'), Locale('en', 'US')],
|
||||
localizationsDelegates: const [
|
||||
AppLocalizations.delegate,
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
theme: AppTheme.lightTheme,
|
||||
routerConfig: sl<GoRouter>(),
|
||||
builder: (context, child) {
|
||||
return _LifecycleListener(child: _UpdateChecker(child: child!));
|
||||
return BlocBuilder<ThemeCubit, ThemeMode>(
|
||||
bloc: themeCubit,
|
||||
builder: (context, themeMode) {
|
||||
return MaterialApp.router(
|
||||
title: 'Maibu Satabot',
|
||||
locale: locale,
|
||||
supportedLocales: const [Locale('zh', 'CN'), Locale('en', 'US')],
|
||||
localizationsDelegates: const [
|
||||
AppLocalizations.delegate,
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
theme: AppTheme.lightTheme,
|
||||
darkTheme: AppTheme.darkTheme,
|
||||
themeMode: themeMode,
|
||||
routerConfig: sl<GoRouter>(),
|
||||
builder: (context, child) {
|
||||
return _LifecycleListener(child: _UpdateChecker(child: child!));
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user