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
zhuoyuan
2022-04-30 00:41:33 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8e7570e0f089a45a38e7d56a481584483890cbb7
8e7570e0
1 parent
55c49a17
Revert "修正宽度和高度为无视屏幕的方向"
This reverts commit
dc21e4a7
.
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
35 deletions
example/lib/src/home.dart
lib/src/screen_util.dart
example/lib/src/home.dart
View file @
8e7570e
...
...
@@ -31,7 +31,6 @@ class HomePageScaffold extends StatelessWidget {
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
TextField
(),
Row
(
children:
<
Widget
>[
// Using Extensions
...
...
lib/src/screen_util.dart
View file @
8e7570e
...
...
@@ -121,43 +121,13 @@ class ScreenUtil {
/// 当前设备宽度 dp
/// The horizontal extent of this size.
double
get
screenWidth
{
if
(
_orientation
==
Orientation
.
landscape
)
{
return
(
context
!=
null
?
MediaQuery
.
of
(
context
!).
size
.
height
:
_screenHeight
);
}
return
context
!=
null
?
MediaQuery
.
of
(
context
!).
size
.
width
:
_screenWidth
;
}
double
get
screenWidth
=>
context
!=
null
?
MediaQuery
.
of
(
context
!).
size
.
width
:
_screenWidth
;
///当前设备高度 dp
///The vertical extent of this size. dp
double
get
screenHeight
{
if
(
_orientation
==
Orientation
.
landscape
)
{
return
context
!=
null
?
MediaQuery
.
of
(
context
!).
size
.
width
:
_screenWidth
;
}
return
context
!=
null
?
MediaQuery
.
of
(
context
!).
size
.
height
:
_screenHeight
;
}
Size
get
screenSize
{
if
(
_orientation
==
Orientation
.
landscape
)
{
double
width
=
(
context
!=
null
?
MediaQuery
.
of
(
context
!).
size
.
height
:
_screenHeight
)
+
bottomBarHeight
;
double
height
=
(
context
!=
null
?
MediaQuery
.
of
(
context
!).
size
.
width
:
_screenWidth
);
return
Size
(
width
,
height
);
}
return
Size
(
context
!=
null
?
MediaQuery
.
of
(
context
!).
size
.
width
:
_screenWidth
,
context
!=
null
?
MediaQuery
.
of
(
context
!).
size
.
height
:
_screenHeight
);
}
double
get
screenHeight
=>
context
!=
null
?
MediaQuery
.
of
(
context
!).
size
.
height
:
_screenHeight
;
/// 状态栏高度 dp 刘海屏会更高
/// The offset from the top, in dp
...
...
Please
register
or
login
to post a comment