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
李卓原
2022-04-24 18:23:25 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e7e353a33add2617279907b2715db5f3fb56f4be
e7e353a3
1 parent
90ba5d58
空安全优化
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
lib/src/screen_util.dart
pubspec.yaml
lib/src/screen_util.dart
View file @
e7e353a
...
...
@@ -75,14 +75,16 @@ class ScreenUtil {
/// Initializing the library.
static
void
init
(
BuildContext
context
,
{
BuildContext
?
context
,
{
Orientation
?
orientation
,
Size
?
deviceSize
,
Size
designSize
=
defaultSize
,
bool
splitScreenMode
=
false
,
bool
minTextAdapt
=
false
,
})
{
final
deviceData
=
MediaQuery
.
maybeOf
(
context
).
nonEmptySizeOrNull
();
final
deviceData
=
context
!=
null
?
MediaQuery
.
maybeOf
(
context
).
nonEmptySizeOrNull
()
:
null
;
deviceSize
??=
deviceData
?.
size
??
designSize
;
orientation
??=
deviceData
?.
orientation
??
...
...
@@ -97,7 +99,7 @@ class ScreenUtil {
..
_orientation
=
orientation
..
_screenWidth
=
deviceSize
.
width
..
_screenHeight
=
deviceSize
.
height
..
context
=
deviceData
!=
null
?
context
:
null
;
..
context
=
context
;
}
///获取屏幕方向
...
...
pubspec.yaml
View file @
e7e353a
...
...
@@ -2,7 +2,6 @@ name: flutter_screenutil
description
:
A flutter plugin for adapting screen and font size.Guaranteed to look good on different models
version
:
5.4.0
homepage
:
https://github.com/OpenFlutter/flutter_screenutil
publish_to
:
https://pub.dev
environment
:
sdk
:
"
>=2.12.0
<3.0.0"
...
...
Please
register
or
login
to post a comment