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
Mounir-Bouaiche
2022-04-27 07:29:19 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9eb2b5054c7adfe8fb1ae9e74a202963f4e618d9
9eb2b505
1 parent
19bdf7d3
Bug Fix: Reaching context that no longer used. (state: DEFUNCT)
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
lib/src/screen_util.dart
lib/src/screen_util.dart
View file @
9eb2b50
...
...
@@ -77,15 +77,19 @@ class ScreenUtil {
static
void
init
(
BuildContext
?
context
,
{
Orientation
?
orientation
,
Size
?
deviceSize
,
Size
designSize
=
defaultSize
,
bool
splitScreenMode
=
false
,
bool
minTextAdapt
=
false
,
})
{
final
deviceData
=
context
!=
null
?
MediaQuery
.
maybeOf
(
context
).
nonEmptySizeOrNull
()
final
mediaQueryContext
=
context
?.
getElementForInheritedWidgetOfExactType
<
MediaQuery
>();
final
deviceData
=
mediaQueryContext
!=
null
?
MediaQuery
.
of
(
context
!).
nonEmptySizeOrNull
()
:
null
;
Size
deviceSize
=
deviceData
?.
size
??
designSize
;
deviceSize
??
=
deviceData
?.
size
??
designSize
;
orientation
??=
deviceData
?.
orientation
??
(
deviceSize
.
width
>
deviceSize
.
height
?
Orientation
.
landscape
...
...
@@ -98,7 +102,7 @@ class ScreenUtil {
..
_orientation
=
orientation
..
_screenWidth
=
deviceSize
.
width
..
_screenHeight
=
deviceSize
.
height
..
context
=
c
ontext
;
..
context
=
mediaQueryC
ontext
;
}
///获取屏幕方向
...
...
Please
register
or
login
to post a comment