ScreenUtil.instance = ScreenUtil(width: 750, height: 1334)..init(context);
...
width: ScreenUtil().setWidth(100),
height: ScreenUtil().setHeight(100),
fontSize: ScreenUtil().setSp(30),
ScreenUtil.pixelRatio
ScreenUtil.screenWidth
ScreenUtil.screenHeight
ScreenUtil.bottomBarHeight
ScreenUtil.statusBarHeight
ScreenUtil.textScaleFactory
ScreenUtil.getInstance().scaleWidth
ScreenUtil.getInstance().scaleHeight
flustars(Flutter常用工具类库)中的ScreenUitl
setDesignWHD(750.0, 1334.0, density: 10);
...
getWidth : 返回根据屏幕宽适配后尺寸.
getHeight : 返回根据屏幕高适配后尺寸.
getWidthPx : 返回根据屏幕宽适配后尺寸.
getHeightPx : 返回根据屏幕高适配后尺寸.
getSp : 返回根据屏幕宽适配后字体尺寸.
screenWidth : 获取屏幕宽.
screenHeight : 获取屏幕高.
screenDensity : 获取屏幕密度.
appBarHeight : 获取系统AppBar高度.
statusBarHeight : 获取系统状态栏高度.
getScreenW(ctx) : 当前屏幕 宽.
getScreenH(ctx) : 当前屏幕 高.
getStatusBarH(ctx) : 当前状态栏高度.
getBottomBarH(ctx) : 当前BottomBar高度.
getScaleW(ctx,size) : 返回根据屏幕宽适配后尺寸. getScaleH(ctx,size) : 返回根据屏幕高适配后尺寸.
getScaleSp(ctx,size) : 返回根据屏幕宽适配后字体尺寸.