横竖屏设置
2020-10-13 本文已影响0人
代码小王子
// 强制竖屏
runApp(MyApp());
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown
]);
}
void main() {
// 强制横屏
runApp(MyApp());
SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight
]);
}