import 'package:flutter/services.dart';
void main(){
// 强制横屏
SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight
]);
runApp(new MyApp());
}
void main(){
// 强制竖屏
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown
]);
runApp(new MyApp());
}
转载于:https://www.jianshu.com/p/5d1d2fe31c7f