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
LiZhuoyuan
2020-09-24 23:59:18 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9451d5e54ca6d88e307e037eee73752f162ea1e4
9451d5e5
1 parent
bfe7835b
readme
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
README.md
README_CN.md
example/lib/main.dart
README.md
View file @
9451d5e
# Please use v2, v3 now has some bugs.
# flutter_screenutil
[

](https://pub.dev/packages/flutter_screenutil)
...
...
README_CN.md
View file @
9451d5e
# 请使用v2,v3现在有一些bug
# flutter_ScreenUtil
[

](https://pub.dartlang.org/packages/flutter_screenutil)
...
...
example/lib/main.dart
View file @
9451d5e
...
...
@@ -38,7 +38,7 @@ class ExampleWidget extends StatefulWidget {
class
_ExampleWidgetState
extends
State
<
ExampleWidget
>
{
@override
Widget
build
(
BuildContext
context
)
{
//
printScreenInformation();
printScreenInformation
();
return
Scaffold
(
appBar:
AppBar
(
title:
Text
(
widget
.
title
),
...
...
@@ -135,16 +135,13 @@ class _ExampleWidgetState extends State<ExampleWidget> {
void
printScreenInformation
()
{
print
(
'Device width dp:
${ScreenUtil().screenWidth}
'
);
//Device width
print
(
'Device height dp:
${ScreenUtil().screenHeight}
'
);
//Device height
print
(
'Device pixel density:
${ScreenUtil().pixelRatio}
'
);
//Device pixel density
print
(
'Device pixel density:
${ScreenUtil().pixelRatio}
'
);
//Device pixel density
print
(
'Bottom safe zone distance dp:
${ScreenUtil().bottomBarHeight}
'
);
//Bottom safe zone distance,suitable for buttons with full screen
print
(
'Status bar height px:
${ScreenUtil().statusBarHeight}
dp'
);
//Status bar height , Notch will be higher Unit px
print
(
'Ratio of actual width dp to design draft px:
${ScreenUtil().scaleWidth}
'
);
print
(
'Ratio of actual height dp to design draft px:
${ScreenUtil().scaleHeight}
'
);
print
(
'Ratio of actual width dp to design draft px:
${ScreenUtil().scaleWidth}
'
);
print
(
'Ratio of actual height dp to design draft px:
${ScreenUtil().scaleHeight}
'
);
print
(
'The ratio of font and width to the size of the design:
${ScreenUtil().scaleWidth * ScreenUtil().pixelRatio}
'
);
print
(
...
...
@@ -154,3 +151,4 @@ class _ExampleWidgetState extends State<ExampleWidget> {
print
(
'0.5 times the screen height:
${0.5.hp}
'
);
}
}
...
...
Please
register
or
login
to post a comment