Commit d89810d0 authored by akari's avatar akari
parents 59de0036 fbfad9ea
......@@ -48,9 +48,15 @@ Future<void> main(List<String> args) async {
..register(WidgetDetailInspector())
..register(Console());
// ..register(DioInspector(dio: ApiClient.instance().dio));
// 全局全屏:隐藏系统状态栏和底部导航栏
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
runApp(UMEWidget(enable: true, child: const MyApp()));
} else {
WidgetsFlutterBinding.ensureInitialized();
// 全局全屏:隐藏系统状态栏和底部导航栏
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
runApp(const MyApp());
}
// runApp(const MyApp());
......@@ -99,9 +105,6 @@ class _MyAppState extends State<MyApp> {
);
_appRouter = AppRouter();
// 全局全屏:隐藏系统状态栏和底部导航栏
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
// 监听 Token 过期事件
_tokenExpiredSubscription =
eventBus.on<TokenExpiredEvent>().listen((event) {
......@@ -215,6 +218,12 @@ class _MyAppState extends State<MyApp> {
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