File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ class ScreenUtil {
34
34
_pixelRatio = window.devicePixelRatio;
35
35
_screenWidth = window.physicalSize.width / _pixelRatio;
36
36
_screenHeight = window.physicalSize.height / _pixelRatio;
37
- _statusBarHeight = window.padding.top / _pixelRatio ;
38
- _bottomBarHeight = window.padding.bottom / _pixelRatio ;
37
+ _statusBarHeight = window.padding.top;
38
+ _bottomBarHeight = window.padding.bottom;
39
39
_textScaleFactor = window.textScaleFactor;
40
40
}
41
41
@@ -83,11 +83,11 @@ class ScreenUtil {
83
83
84
84
/// 状态栏高度 dp 刘海屏会更高
85
85
/// The offset from the top
86
- double get statusBarHeight => _statusBarHeight;
86
+ double get statusBarHeight => _statusBarHeight / _pixelRatio ;
87
87
88
88
/// 底部安全区距离 dp
89
89
/// The offset from the bottom.
90
- double get bottomBarHeight => _bottomBarHeight;
90
+ double get bottomBarHeight => _bottomBarHeight / _pixelRatio ;
91
91
92
92
/// 实际的dp与UI设计px的比例
93
93
/// The ratio of the actual dp to the design draft px
You can’t perform that action at this time.
0 commit comments