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
8cf15ee2
Unverified
Commit
8cf15ee2
authored
Jun 10, 2020
by
Per Classon
Committed by
GitHub
Jun 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rebuild SliverAppBar when forceElevated changes (#59162)
parent
319a61fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
app_bar.dart
packages/flutter/lib/src/material/app_bar.dart
+2
-1
app_bar_test.dart
packages/flutter/test/material/app_bar_test.dart
+25
-0
No files found.
packages/flutter/lib/src/material/app_bar.dart
View file @
8cf15ee2
...
...
@@ -860,7 +860,8 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
||
pinned
!=
oldDelegate
.
pinned
||
floating
!=
oldDelegate
.
floating
||
snapConfiguration
!=
oldDelegate
.
snapConfiguration
||
stretchConfiguration
!=
oldDelegate
.
stretchConfiguration
;
||
stretchConfiguration
!=
oldDelegate
.
stretchConfiguration
||
forceElevated
!=
oldDelegate
.
forceElevated
;
}
@override
...
...
packages/flutter/test/material/app_bar_test.dart
View file @
8cf15ee2
...
...
@@ -891,6 +891,31 @@ void main() {
expect
(
tabBarHeight
(
tester
),
initialTabBarHeight
);
});
testWidgets
(
'SliverAppBar rebuilds when forceElevated changes'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/59158.
Widget
buildSliverAppBar
(
bool
forceElevated
)
{
return
MaterialApp
(
home:
CustomScrollView
(
slivers:
<
Widget
>[
SliverAppBar
(
title:
const
Text
(
'Title'
),
forceElevated:
forceElevated
,
),
],
),
);
}
final
Finder
appBarFinder
=
find
.
byType
(
AppBar
);
AppBar
getAppBarWidget
(
Finder
finder
)
=>
tester
.
widget
<
AppBar
>(
finder
);
await
tester
.
pumpWidget
(
buildSliverAppBar
(
false
));
expect
(
getAppBarWidget
(
appBarFinder
).
elevation
,
0.0
);
await
tester
.
pumpWidget
(
buildSliverAppBar
(
true
));
expect
(
getAppBarWidget
(
appBarFinder
).
elevation
,
4.0
);
});
testWidgets
(
'AppBar dimensions, with and without bottom, primary'
,
(
WidgetTester
tester
)
async
{
const
MediaQueryData
topPadding100
=
MediaQueryData
(
padding:
EdgeInsets
.
only
(
top:
100.0
));
...
...
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