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:26:04 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cbbfb9115c32d494b2b4188467cabb29a3eff4d6
cbbfb911
1 parent
321cd024
fix #150
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
lib/screenutil.dart
lib/screenutil.dart
View file @
cbbfb91
...
...
@@ -34,8 +34,8 @@ class ScreenUtil {
_pixelRatio
=
window
.
devicePixelRatio
;
_screenWidth
=
window
.
physicalSize
.
width
/
_pixelRatio
;
_screenHeight
=
window
.
physicalSize
.
height
/
_pixelRatio
;
_statusBarHeight
=
window
.
padding
.
top
;
_bottomBarHeight
=
window
.
padding
.
bottom
;
_statusBarHeight
=
window
.
padding
.
top
/
_pixelRatio
;
_bottomBarHeight
=
window
.
padding
.
bottom
/
_pixelRatio
;
_textScaleFactor
=
window
.
textScaleFactor
;
}
...
...
@@ -119,11 +119,8 @@ class ScreenUtil {
///Font size adaptation method
///@param [fontSize] The size of the font on the UI design, in px.
///@param [allowFontScaling]
num
setSp
(
num
fontSize
,
{
bool
allowFontScalingSelf
})
=>
allowFontScalingSelf
==
null
?
(
allowFontScaling
?
(
fontSize
*
scaleText
)
:
((
fontSize
*
scaleText
)
/
_textScaleFactor
))
num
setSp
(
num
fontSize
,
{
bool
allowFontScalingSelf
})
=>
allowFontScalingSelf
==
null
?
(
allowFontScaling
?
(
fontSize
*
scaleText
)
:
((
fontSize
*
scaleText
)
/
_textScaleFactor
))
:
(
allowFontScalingSelf
?
(
fontSize
*
scaleText
)
:
((
fontSize
*
scaleText
)
/
_textScaleFactor
));
...
...
Please
register
or
login
to post a comment