Skip to content

Commit 31724dc

Browse files
committed
fix(feed): enable scrolling for sliver app bar
This commit fixes the static behavior of the FeedSliverAppBar. By adding the "snap: true" property to the SliverAppBar, the app bar now correctly scrolls out of view with the content and snaps back into view on a slight upward scroll, providing the intended modern feed experience.
1 parent a64b8c3 commit 31724dc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/headlines-feed/widgets/feed_sliver_app_bar.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ class FeedSliverAppBar extends StatelessWidget {
3131
pinned: true,
3232
// The app bar will become visible as soon as the user scrolls up.
3333
floating: true,
34+
// The app bar will snap into view when scrolling up, even if the user
35+
// stops scrolling partway. This works in conjunction with `floating` to
36+
// create the desired scrolling effect.
37+
snap: true,
3438
// The title is a custom search bar widget.
3539
title: GestureDetector(
3640
onTap: () {

0 commit comments

Comments
 (0)