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
f789acae
Unverified
Commit
f789acae
authored
Apr 16, 2021
by
Kate Lovett
Committed by
GitHub
Apr 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Fix FlexibleSpaceBar Opacity when AppBar.toolbarHeight > ktoolbarHeight (#80453)" (#80545)
parent
254e83af
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
38 deletions
+2
-38
flexible_space_bar.dart
packages/flutter/lib/src/material/flexible_space_bar.dart
+1
-5
flexible_space_bar_test.dart
packages/flutter/test/material/flexible_space_bar_test.dart
+1
-33
No files found.
packages/flutter/lib/src/material/flexible_space_bar.dart
View file @
f789acae
...
...
@@ -305,11 +305,7 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> {
final
double
fadeStart
=
math
.
max
(
0.0
,
1.0
-
kToolbarHeight
/
deltaExtent
);
const
double
fadeEnd
=
1.0
;
assert
(
fadeStart
<=
fadeEnd
);
// If the min and max extent are the same, the app bar cannot collapse
// and the content should be visible, so opacity = 1.
final
double
opacity
=
settings
.
maxExtent
==
settings
.
minExtent
?
1.0
:
1.0
-
Interval
(
fadeStart
,
fadeEnd
).
transform
(
t
);
final
double
opacity
=
1.0
-
Interval
(
fadeStart
,
fadeEnd
).
transform
(
t
);
double
height
=
settings
.
maxExtent
;
// StretchMode.zoomBackground
...
...
packages/flutter/test/material/flexible_space_bar_test.dart
View file @
f789acae
...
...
@@ -121,39 +121,7 @@ void main() {
expect
(
clipRect
.
size
.
height
,
minExtent
);
});
testWidgets
(
'FlexibleSpaceBar.background is visible when using height other than kToolbarHeight'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/80451
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Scaffold
(
appBar:
AppBar
(
toolbarHeight:
300
,
flexibleSpace:
const
FlexibleSpaceBar
(
title:
Text
(
'Title'
),
background:
Text
(
'Background'
),
collapseMode:
CollapseMode
.
pin
,
),
),
body:
CustomScrollView
(
primary:
true
,
slivers:
<
Widget
>[
SliverToBoxAdapter
(
child:
Container
(
height:
1200.0
,
color:
Colors
.
orange
[
400
],
),
),
],
),
),
),
);
final
Opacity
backgroundOpacity
=
tester
.
firstWidget
(
find
.
byType
(
Opacity
));
expect
(
backgroundOpacity
.
opacity
,
1.0
);
});
testWidgets
(
'Collapsed FlexibleSpaceBar has correct semantics'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Collpased FlexibleSpaceBar has correct semantics'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
const
double
expandedHeight
=
200
;
await
tester
.
pumpWidget
(
...
...
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