配置:
找到android/app/src/main/res/values目录,打开styles.xml 将shortEdges放到style标签内。
<!--关于全屏显示-->
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>

代码(Flutter 3之后的):
//隐藏顶部和底部状态栏
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
//恢复系统默认
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: SystemUiOverlay.values);
示例图:
![图片[2]-Flutter 显示/隐藏系统状态栏,无黑边-IT网络技术分享](https://zywi.cn/wp-content/uploads/2024/06/66b84b4617130311.png)
![图片[3]-Flutter 显示/隐藏系统状态栏,无黑边-IT网络技术分享](https://zywi.cn/wp-content/uploads/2024/06/d926793b55130336.png)
THE END
暂无评论内容