📜  如何在颤振中将设备设置为自动旋转 - Dart 代码示例

📅  最后修改于: 2022-03-11 14:48:06.089000             🧑  作者: Mango

代码示例1
void initState() {
    super.initState();
    SystemChrome.setPreferredOrientations([
      DeviceOrientation.landscapeRight,
      DeviceOrientation.landscapeLeft,
    ]);
  }
  @override
  dispose(){
     SystemChrome.setPreferredOrientations([
        DeviceOrientation.portraitUp,
        DeviceOrientation.portraitDown,
      ]);
    super.dispose();
  }