SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp])
.then((_) {
runApp( MyApp());
});
flutter iOS 安卓 禁止横屏显示
最新推荐文章于 2025-04-12 10:16:12 发布
本文介绍如何使用SystemChrome API来设置Flutter应用的方向为竖屏向上。通过调用setPreferredOrientations方法并传入DeviceOrientation.portraitUp参数,可以确保应用在运行时保持竖屏模式。
787





