• flutter 强制竖屏和横屏


    参考:https://blog.csdn.net/u013185272/article/details/85695630?utm_medium=distribute.pc_relevant.none-task-blog-searchFromBaidu-3.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-searchFromBaidu-3.control

    强制横屏:

    void main(){
      // 强制横屏
      SystemChrome.setPreferredOrientations([
        DeviceOrientation.landscapeLeft,
        DeviceOrientation.landscapeRight
      ]);
     
      runApp(new MyApp());
    }

    强制竖屏:

    void main(){
      // 强制竖屏
      SystemChrome.setPreferredOrientations([
        DeviceOrientation.portraitUp,
        DeviceOrientation.portraitDown
      ]);
     
      runApp(new MyApp());
    }

    以上代码写在main.dart文件中

  • 相关阅读:
    7.Linux学习
    5.@AliasFor注解
    5.Maven学习
    3.postman
    4.git总结
    8.Docker学习
    6.idea教程
    2.jwt
    4.open feign
    1.MarkDown常规使用语法
  • 原文地址:https://www.cnblogs.com/lude1994/p/14307389.html
Copyright © 2020-2023  润新知