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
Toby
2023-05-31 14:31:47 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2023-05-31 14:31:47 +0800
Commit
26a4b1f396f366d160ce742d905679846b3f922c
26a4b1f3
1 parent
1479ea46
推荐使用 useInheritedMediaQuery 为 false (#485)
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
lib/src/screenutil_init.dart
lib/src/screenutil_init.dart
View file @
26a4b1f
...
...
@@ -39,7 +39,7 @@ class ScreenUtilInit extends StatefulWidget {
this
.
designSize
=
ScreenUtil
.
defaultSize
,
this
.
splitScreenMode
=
false
,
this
.
minTextAdapt
=
false
,
this
.
useInheritedMediaQuery
=
tru
e
,
this
.
useInheritedMediaQuery
=
fals
e
,
this
.
scaleByHeight
=
false
})
:
super
(
key:
key
);
...
...
@@ -76,15 +76,17 @@ class _ScreenUtilInitState extends State<ScreenUtilInit>
wrappedInMediaQuery
=
true
;
return
data
;
}
}
else
{
final
data
=
MediaQuery
.
maybeOf
(
context
);
if
(
data
!=
null
)
{
return
data
;
}
}
return
MediaQueryData
.
fromView
(
View
.
of
(
context
));
}
Widget
get
child
{
return
widget
.
builder
.
call
(
context
,
widget
.
child
);
}
_updateTree
(
Element
el
)
{
el
.
markNeedsBuild
();
el
.
visitChildren
(
_updateTree
);
...
...
@@ -148,7 +150,7 @@ class _ScreenUtilInitState extends State<ScreenUtilInit>
widget
.
designSize
.
height
:
deviceSize
.
width
,
height:
deviceSize
.
height
,
child:
child
,
child:
widget
.
builder
(
__context
,
widget
.
child
)
,
),
));
},
...
...
@@ -176,7 +178,7 @@ class _ScreenUtilInitState extends State<ScreenUtilInit>
widget
.
designSize
.
height
:
deviceSize
.
width
,
height:
deviceSize
.
height
,
child:
child
,
child:
widget
.
builder
(
_context
,
widget
.
child
)
,
),
));
}
...
...
Please
register
or
login
to post a comment