zoukankan      html  css  js  c++  java
  • flutter 适配

    代码:

    ScreenUtil.instance = ScreenUtil( 750,height: 1334)..init(context);
    print('设备像素密度:${ScreenUtil.pixelRatio}');
    print('设备高度:${ScreenUtil.screenHeight}');
    print('设备宽度:${ScreenUtil.screenWidth}');
    return Container(
    height: ScreenUtil().setHeight(333),
    ScreenUtil().setWidth(750),
    总结
     

    //插件屏幕适配 flutter_screenutil

     

    现在 pubspec.yaml 导入 flutter_screenutil

    //初始化

    ScreenUtil.instence = ScreenUtil(w,height:h)..init(context); //w 和 h  都是UI 按照什么尺寸设计的

     

     

      print('设备像素密度:${ScreenUtil.pixelRatio}');

        print('设备高度:${ScreenUtil.screenHeight}');

        print('设备宽度:${ScreenUtil.screenWidth}');

     

     

    控件使用

    xxx(

    width :ScreenUtil().setWidth(www);

    height:ScreenUtil().setHeight(hhh);

    )

  • 相关阅读:
    模式对象管理
    Oracle数据库实例
    github使用简介
    Oracle数据库安装与连接与简介
    利益相关者分析
    问题账户需求分析
    2018春季学期需求工程概论阅读计划
    JAXB在Java 9/10并且使用Tomcat 9的问题
    mysql 备份 恢复
    IntelliJ IDEA安装bower
  • 原文地址:https://www.cnblogs.com/pp-pping/p/12222500.html
Copyright © 2011-2022 走看看