Commit 907782b8 authored by 张宏's avatar 张宏

1111

parent b5abe691
......@@ -188,42 +188,21 @@ class _MyAppState extends State<MyApp> {
),
// BlocProvider<CounterBloc>(create: (_) => CounterBloc()),
],
child: MultiBlocListener(
listeners: [
// // AuthBloc 监听器 - 处理登录/Token 过期/登出
// BlocListener<AuthBloc, AuthState>(
// listener: (context, state) {
// if (state is AuthSuccess) {
// _appRouter.replaceAll([const DefaultLayoutRoute()]);
// }
// if (state is AuthTokenExpired) {
// _silentLogin();
// }
// if (state is AuthLoggedOut) {
// _silentLogin();
// }
// },
// ),
// 未来在这里添加其他 Bloc 的监听器:
// BlocListener<UserBloc, UserState>(listener: ...),
// BlocListener<SettingsBloc, SettingsState>(listener: ...),
child: Stack(
children: [
MaterialApp.router(
scaffoldMessengerKey: _scaffoldMessengerKey,
routerConfig: _appRouter.config(),
debugShowCheckedModeBanner: false,
builder: (context, child) {
// 每次页面重建时重新隐藏状态栏,防止路由切换后状态栏重新出现
SystemChrome.setEnabledSystemUIMode(
SystemUiMode.manual, overlays: []);
return child ?? const SizedBox.shrink();
},
),
if (_isInitializing) _buildSplash(),
],
child: Stack(
children: [
MaterialApp.router(
scaffoldMessengerKey: _scaffoldMessengerKey,
routerConfig: _appRouter.config(),
debugShowCheckedModeBanner: false,
builder: (context, child) {
// 每次页面重建时重新隐藏状态栏,防止路由切换后状态栏重新出现
SystemChrome.setEnabledSystemUIMode(
SystemUiMode.manual, overlays: []);
return child ?? const SizedBox.shrink();
},
),
if (_isInitializing) _buildSplash(),
],
),
),
);
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment