flutter全屏的方法

更新时间:2023-05-25 21:55
方法1:
// to hide only bottom bar:
SystemChrome.setEnabledSystemUIOverlays ([SystemUiOverlay.top]);
// to hide only status bar: 
SystemChrome.setEnabledSystemUIOverlays ([SystemUiOverlay.bottom]);
// to hide both:
SystemChrome.setEnabledSystemUIOverlays ([]);

方法2:适用安卓

在 res/values/ 中找到styles.xml:

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowFullscreen">true</item>
</style>

参考:
android - About the Full Screen And No Titlebar from manifest - Stack Overflow
安卓-使飘动应用程序全屏-堆栈溢出 (stackoverflow.com)
dart - How to show fullscreen image in flutter - Stack Overflow