Commit cf112417 by tanghuan

横屏时,隐藏顶部的系统状态栏

1 parent f9f42622
......@@ -111,12 +111,16 @@ class LinkCubit extends Cubit<LinkState> {
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);
// 隐藏状态栏
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);
} else {
// 竖屏模式(默认)
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
// 显示状态栏
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
}
}
......
......@@ -21,12 +21,16 @@ class ScreenHandler extends MessageHandler {
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);
// 隐藏状态栏
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);
} else {
// 竖屏模式(默认)
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
// 显示状态栏
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
}
}
}
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!