将flutter 应用设置为坚屏
void main() { WidgetsFlutterBinding.ensureInitialized(); //必须要添加这个进行初始化 否则下面会错误 SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]) .then((_) { runApp(MyApp()); }); }