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
mleevi
2023-11-01 09:47:42 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2023-11-01 03:47:42 -0500
Commit
b780eb794411c46f51bbc7426ea36b1965450f86
b780eb79
1 parent
03a575f8
don't use future builder when not ensureScreenSize (#517)
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
lib/src/screenutil_init.dart
lib/src/screenutil_init.dart
View file @
b780eb7
...
...
@@ -73,7 +73,7 @@ class ScreenUtilInit extends StatefulWidget {
this
.
splitScreenMode
=
false
,
this
.
minTextAdapt
=
false
,
this
.
useInheritedMediaQuery
=
false
,
this
.
ensureScreenSize
,
this
.
ensureScreenSize
=
false
,
this
.
responsiveWidgets
,
this
.
fontSizeResolver
=
FontSizeResolvers
.
width
,
})
:
super
(
key:
key
);
...
...
@@ -83,7 +83,7 @@ class ScreenUtilInit extends StatefulWidget {
final
bool
splitScreenMode
;
final
bool
minTextAdapt
;
final
bool
useInheritedMediaQuery
;
final
bool
?
ensureScreenSize
;
final
bool
ensureScreenSize
;
final
RebuildFactor
rebuildFactor
;
final
FontSizeResolver
fontSizeResolver
;
...
...
@@ -133,7 +133,7 @@ class _ScreenUtilInitState extends State<ScreenUtilInit>
}
Future
<
void
>
_validateSize
()
async
{
if
(
widget
.
ensureScreenSize
??
false
)
return
ScreenUtil
.
ensureScreenSize
();
if
(
widget
.
ensureScreenSize
)
return
ScreenUtil
.
ensureScreenSize
();
}
void
_markNeedsBuildIfAllowed
(
Element
el
)
{
...
...
@@ -171,6 +171,18 @@ class _ScreenUtilInitState extends State<ScreenUtilInit>
if
(
mq
==
null
)
return
const
SizedBox
.
shrink
();
if
(!
widget
.
ensureScreenSize
)
{
ScreenUtil
.
configure
(
data:
mq
,
designSize:
widget
.
designSize
,
splitScreenMode:
widget
.
splitScreenMode
,
minTextAdapt:
widget
.
minTextAdapt
,
fontSizeResolver:
widget
.
fontSizeResolver
,
);
return
widget
.
builder
?.
call
(
context
,
widget
.
child
)
??
widget
.
child
!;
}
return
FutureBuilder
<
void
>(
future:
_screenSizeCompleter
.
future
,
builder:
(
c
,
snapshot
)
{
...
...
Please
register
or
login
to post a comment