Unverified Commit 55dc9f93 authored by Taha Tesser's avatar Taha Tesser Committed by GitHub

Refactor `SliverAppBar.medium` & `SliverAppBar.large` to fix several issues (#122542)

Refactor `SliverAppBar.medium` & `SliverAppBar.large` to fix several issues
parent 62cb61d3
...@@ -2720,8 +2720,8 @@ void main() { ...@@ -2720,8 +2720,8 @@ void main() {
return <Widget>[ return <Widget>[
SliverOverlapAbsorber( SliverOverlapAbsorber(
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context), handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
sliver: SliverAppBar.medium( sliver: const SliverAppBar.medium(
title: const Text('AppBar Title'), title: Text('AppBar Title'),
), ),
), ),
]; ];
...@@ -2747,11 +2747,11 @@ void main() { ...@@ -2747,11 +2747,11 @@ void main() {
)); ));
// There are two widgets for the title. // There are two widgets for the title.
final Finder expandedTitle = find.text('AppBar Title').last; final Finder expandedTitle = find.text('AppBar Title').first;
final Finder expandedTitleClip = find.ancestor( final Finder expandedTitleClip = find.ancestor(
of: expandedTitle, of: expandedTitle,
matching: find.byType(ClipRect), matching: find.byType(ClipRect),
); ).first;
// Default, fully expanded app bar. // Default, fully expanded app bar.
expect(nestedScrollView.currentState?.outerController.offset, 0); expect(nestedScrollView.currentState?.outerController.offset, 0);
...@@ -2830,11 +2830,11 @@ void main() { ...@@ -2830,11 +2830,11 @@ void main() {
)); ));
// There are two widgets for the title. // There are two widgets for the title.
final Finder expandedTitle = find.text('AppBar Title').last; final Finder expandedTitle = find.text('AppBar Title').first;
final Finder expandedTitleClip = find.ancestor( final Finder expandedTitleClip = find.ancestor(
of: expandedTitle, of: expandedTitle,
matching: find.byType(ClipRect), matching: find.byType(ClipRect),
); ).first;
// Default, fully expanded app bar. // Default, fully expanded app bar.
expect(nestedScrollView.currentState?.outerController.offset, 0); expect(nestedScrollView.currentState?.outerController.offset, 0);
......
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