Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
flutter_screenutil
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
李卓原
2020-09-21 11:28:33 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
27415ccc8166a413d7b348788024781e94a122af
27415ccc
1 parent
cbbfb911
fix #150
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
lib/screenutil.dart
lib/screenutil.dart
View file @
27415cc
...
...
@@ -34,8 +34,8 @@ class ScreenUtil {
_pixelRatio
=
window
.
devicePixelRatio
;
_screenWidth
=
window
.
physicalSize
.
width
/
_pixelRatio
;
_screenHeight
=
window
.
physicalSize
.
height
/
_pixelRatio
;
_statusBarHeight
=
window
.
padding
.
top
/
_pixelRatio
;
_bottomBarHeight
=
window
.
padding
.
bottom
/
_pixelRatio
;
_statusBarHeight
=
window
.
padding
.
top
;
_bottomBarHeight
=
window
.
padding
.
bottom
;
_textScaleFactor
=
window
.
textScaleFactor
;
}
...
...
@@ -83,11 +83,11 @@ class ScreenUtil {
/// 状态栏高度 dp 刘海屏会更高
/// The offset from the top
double
get
statusBarHeight
=>
_statusBarHeight
;
double
get
statusBarHeight
=>
_statusBarHeight
/
_pixelRatio
;
/// 底部安全区距离 dp
/// The offset from the bottom.
double
get
bottomBarHeight
=>
_bottomBarHeight
;
double
get
bottomBarHeight
=>
_bottomBarHeight
/
_pixelRatio
;
/// 实际的dp与UI设计px的比例
/// The ratio of the actual dp to the design draft px
...
...
Please
register
or
login
to post a comment