Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
3af97d22
Unverified
Commit
3af97d22
authored
Aug 06, 2020
by
chunhtai
Committed by
GitHub
Aug 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the flexible space bar to still create a rendering object even if… (#62690)
parent
6ab558d8
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
278 additions
and
34 deletions
+278
-34
flexible_space_bar.dart
packages/flutter/lib/src/material/flexible_space_bar.dart
+34
-34
flexible_space_bar_test.dart
packages/flutter/test/material/flexible_space_bar_test.dart
+244
-0
No files found.
packages/flutter/lib/src/material/flexible_space_bar.dart
View file @
3af97d22
...
...
@@ -303,42 +303,42 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> {
const
double
fadeEnd
=
1.0
;
assert
(
fadeStart
<=
fadeEnd
);
final
double
opacity
=
1.0
-
Interval
(
fadeStart
,
fadeEnd
).
transform
(
t
);
if
(
opacity
>
0.0
)
{
double
height
=
settings
.
maxExtent
;
// StretchMode.zoomBackground
if
(
widget
.
stretchModes
.
contains
(
StretchMode
.
zoomBackground
)
&&
constraints
.
maxHeight
>
height
)
{
height
=
constraints
.
maxHeight
;
}
children
.
add
(
Positioned
(
top:
_getCollapsePadding
(
t
,
settings
),
left:
0.0
,
right:
0.0
,
height:
height
,
child:
Opacity
(
opacity:
opacity
,
child:
widget
.
background
,
),
));
double
height
=
settings
.
maxExtent
;
// StretchMode.blurBackground
if
(
widget
.
stretchModes
.
contains
(
StretchMode
.
blurBackground
)
&&
constraints
.
maxHeight
>
settings
.
maxExtent
)
{
final
double
blurAmount
=
(
constraints
.
maxHeight
-
settings
.
maxExtent
)
/
10
;
children
.
add
(
Positioned
.
fill
(
child:
BackdropFilter
(
child:
Container
(
color:
Colors
.
transparent
,
),
filter:
ui
.
ImageFilter
.
blur
(
sigmaX:
blurAmount
,
sigmaY:
blurAmount
,
)
// StretchMode.zoomBackground
if
(
widget
.
stretchModes
.
contains
(
StretchMode
.
zoomBackground
)
&&
constraints
.
maxHeight
>
height
)
{
height
=
constraints
.
maxHeight
;
}
children
.
add
(
Positioned
(
top:
_getCollapsePadding
(
t
,
settings
),
left:
0.0
,
right:
0.0
,
height:
height
,
child:
Opacity
(
// IOS is relying on this semantics node to correctly traverse
// through the app bar when it is collapsed.
alwaysIncludeSemantics:
true
,
opacity:
opacity
,
child:
widget
.
background
,
),
));
// StretchMode.blurBackground
if
(
widget
.
stretchModes
.
contains
(
StretchMode
.
blurBackground
)
&&
constraints
.
maxHeight
>
settings
.
maxExtent
)
{
final
double
blurAmount
=
(
constraints
.
maxHeight
-
settings
.
maxExtent
)
/
10
;
children
.
add
(
Positioned
.
fill
(
child:
BackdropFilter
(
child:
Container
(
color:
Colors
.
transparent
,
),
filter:
ui
.
ImageFilter
.
blur
(
sigmaX:
blurAmount
,
sigmaY:
blurAmount
,
)
)
);
}
)
));
}
}
...
...
packages/flutter/test/material/flexible_space_bar_test.dart
View file @
3af97d22
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment