Unverified Commit 3af97d22 authored by chunhtai's avatar chunhtai Committed by GitHub

Fix the flexible space bar to still create a rendering object even if… (#62690)

parent 6ab558d8
...@@ -303,7 +303,6 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> { ...@@ -303,7 +303,6 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> {
const double fadeEnd = 1.0; const double fadeEnd = 1.0;
assert(fadeStart <= fadeEnd); assert(fadeStart <= fadeEnd);
final double opacity = 1.0 - Interval(fadeStart, fadeEnd).transform(t); final double opacity = 1.0 - Interval(fadeStart, fadeEnd).transform(t);
if (opacity > 0.0) {
double height = settings.maxExtent; double height = settings.maxExtent;
// StretchMode.zoomBackground // StretchMode.zoomBackground
...@@ -311,13 +310,15 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> { ...@@ -311,13 +310,15 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> {
constraints.maxHeight > height) { constraints.maxHeight > height) {
height = constraints.maxHeight; height = constraints.maxHeight;
} }
children.add(Positioned( children.add(Positioned(
top: _getCollapsePadding(t, settings), top: _getCollapsePadding(t, settings),
left: 0.0, left: 0.0,
right: 0.0, right: 0.0,
height: height, height: height,
child: Opacity( child: Opacity(
// IOS is relying on this semantics node to correctly traverse
// through the app bar when it is collapsed.
alwaysIncludeSemantics: true,
opacity: opacity, opacity: opacity,
child: widget.background, child: widget.background,
), ),
...@@ -340,7 +341,6 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> { ...@@ -340,7 +341,6 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> {
)); ));
} }
} }
}
// title // title
if (widget.title != null) { if (widget.title != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment