@@ -38,7 +38,7 @@ class ExampleWidget extends StatefulWidget {
3838class _ExampleWidgetState extends State <ExampleWidget > {
3939 @override
4040 Widget build (BuildContext context) {
41- // printScreenInformation();
41+ printScreenInformation ();
4242 return Scaffold (
4343 appBar: AppBar (
4444 title: Text (widget.title),
@@ -135,16 +135,13 @@ class _ExampleWidgetState extends State<ExampleWidget> {
135135 void printScreenInformation () {
136136 print ('Device width dp:${ScreenUtil ().screenWidth }' ); //Device width
137137 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
140139 print (
141140 'Bottom safe zone distance dp:${ScreenUtil ().bottomBarHeight }' ); //Bottom safe zone distance,suitable for buttons with full screen
142141 print (
143142 '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 }' );
148145 print (
149146 'The ratio of font and width to the size of the design:${ScreenUtil ().scaleWidth * ScreenUtil ().pixelRatio }' );
150147 print (
@@ -154,3 +151,4 @@ class _ExampleWidgetState extends State<ExampleWidget> {
154151 print ('0.5 times the screen height:${0.5 .hp }' );
155152 }
156153}
154+
0 commit comments