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
2e8faec0
Unverified
Commit
2e8faec0
authored
Dec 23, 2020
by
Ritvij Kumar Sharma
Committed by
GitHub
Dec 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue for SliverAppBar collapsedHeight (#72300)
parent
849784e2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
app_bar.dart
packages/flutter/lib/src/material/app_bar.dart
+1
-1
app_bar_test.dart
packages/flutter/test/material/app_bar_test.dart
+19
-0
No files found.
packages/flutter/lib/src/material/app_bar.dart
View file @
2e8faec0
...
...
@@ -1464,7 +1464,7 @@ class SliverAppBar extends StatefulWidget {
assert
(
toolbarHeight
!=
null
),
assert
(
floating
||
!
snap
,
'The "snap" argument only makes sense for floating app bars.'
),
assert
(
stretchTriggerOffset
>
0.0
),
assert
(
collapsedHeight
==
null
||
collapsedHeight
>
toolbarHeight
,
'The "collapsedHeight" argument has to be larger than
[toolbarHeight].'
),
assert
(
collapsedHeight
==
null
||
collapsedHeight
>
=
toolbarHeight
,
'The "collapsedHeight" argument has to be larger than or equal to
[toolbarHeight].'
),
super
(
key:
key
);
/// {@macro flutter.material.appbar.leading}
...
...
packages/flutter/test/material/app_bar_test.dart
View file @
2e8faec0
...
...
@@ -2198,6 +2198,25 @@ void main() {
expect
(
appBarHeight
(
tester
),
collapsedHeight
+
initialTabBarHeight
);
});
testWidgets
(
'SliverAppBar collapsedHeight'
,
(
WidgetTester
tester
)
async
{
const
double
collapsedHeight
=
56.0
;
await
tester
.
pumpWidget
(
buildSliverAppBarApp
(
floating:
false
,
pinned:
false
,
collapsedHeight:
collapsedHeight
));
final
ScrollController
controller
=
primaryScrollController
(
tester
);
final
double
initialTabBarHeight
=
tabBarHeight
(
tester
);
// Scroll the not-pinned appbar out of view, to its collapsed height.
controller
.
jumpTo
(
300.0
);
await
tester
.
pump
();
expect
(
find
.
byType
(
SliverAppBar
),
findsNothing
);
expect
(
appBarHeight
(
tester
),
collapsedHeight
+
initialTabBarHeight
);
});
testWidgets
(
'AppBar respects leadingWidth'
,
(
WidgetTester
tester
)
async
{
const
Key
key
=
Key
(
'leading'
);
await
tester
.
pumpWidget
(
MaterialApp
(
...
...
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