'Status bar height:${ScreenUtil.statusBarHeight}px'); //Status bar height , Notch will be higher Unit px
print(
'The ratio of font and width to the size of the design:${ScreenUtil().scaleWidth}'); //The width is enlarged relative to the design draft
'The ratio of font and width to the size of the design:${ScreenUtil().scaleWidth * ScreenUtil.pixelRatio}'); //The width is enlarged relative to the design draft
print(
'The ratio of height width to the size of the design:${ScreenUtil().scaleHeight}'); //The height is enlarged relative to the design draft
'The ratio of height width to the size of the design:${ScreenUtil().scaleHeight * ScreenUtil.pixelRatio}'); //The height is enlarged relative to the design draft
@@ -41,10 +41,9 @@ class _MyHomePageState extends State<MyHomePage> {
print(
'Status bar height:${ScreenUtil.statusBarHeight}px');//Status bar height , Notch will be higher Unit px
print(
'The ratio of font and width to the size of the design:${ScreenUtil().scaleWidth}');//The width is enlarged relative to the design draft
'Ratio of actual width dp to design draft px:${ScreenUtil().scaleWidth * ScreenUtil.pixelRatio}');//The width is enlarged relative to the design draft
print(
'The ratio of height width to the size of the design:${ScreenUtil().scaleHeight}');//The height is enlarged relative to the design draft
'Ratio of actual height dp to design draft px:${ScreenUtil().scaleHeight * ScreenUtil.pixelRatio}');//The height is enlarged relative to the design draft
returnnewScaffold(
appBar:newAppBar(
title:newText(widget.title),
...
...
@@ -63,7 +62,7 @@ class _MyHomePageState extends State<MyHomePage> {
'My width:${ScreenUtil().setWidth(375)}dp',
style:TextStyle(
color:Colors.white,
fontSize:ScreenUtil().setSp(28,false)),
fontSize:ScreenUtil().setSp(12,false)),
),
),
Container(
...
...
@@ -73,7 +72,7 @@ class _MyHomePageState extends State<MyHomePage> {