@@ -38,7 +38,7 @@ class ExampleWidget extends StatefulWidget {
38
38
class _ExampleWidgetState extends State <ExampleWidget > {
39
39
@override
40
40
Widget build (BuildContext context) {
41
- // printScreenInformation();
41
+ printScreenInformation ();
42
42
return Scaffold (
43
43
appBar: AppBar (
44
44
title: Text (widget.title),
@@ -135,16 +135,13 @@ class _ExampleWidgetState extends State<ExampleWidget> {
135
135
void printScreenInformation () {
136
136
print ('Device width dp:${ScreenUtil ().screenWidth }' ); //Device width
137
137
print ('Device height dp:${ScreenUtil ().screenHeight }' ); //Device height
138
- print (
139
- 'Device pixel density:${ScreenUtil ().pixelRatio }' ); //Device pixel density
138
+ print ('Device pixel density:${ScreenUtil ().pixelRatio }' ); //Device pixel density
140
139
print (
141
140
'Bottom safe zone distance dp:${ScreenUtil ().bottomBarHeight }' ); //Bottom safe zone distance,suitable for buttons with full screen
142
141
print (
143
142
'Status bar height px:${ScreenUtil ().statusBarHeight }dp' ); //Status bar height , Notch will be higher Unit px
144
- print (
145
- 'Ratio of actual width dp to design draft px:${ScreenUtil ().scaleWidth }' );
146
- print (
147
- 'Ratio of actual height dp to design draft px:${ScreenUtil ().scaleHeight }' );
143
+ print ('Ratio of actual width dp to design draft px:${ScreenUtil ().scaleWidth }' );
144
+ print ('Ratio of actual height dp to design draft px:${ScreenUtil ().scaleHeight }' );
148
145
print (
149
146
'The ratio of font and width to the size of the design:${ScreenUtil ().scaleWidth * ScreenUtil ().pixelRatio }' );
150
147
print (
@@ -154,3 +151,4 @@ class _ExampleWidgetState extends State<ExampleWidget> {
154
151
print ('0.5 times the screen height:${0.5 .hp }' );
155
152
}
156
153
}
154
+
0 commit comments