简体   繁体   中英

How to make scrolling page continue even when tabBarView reaches the top? Flutter

The code I ran was the code that was given by Griffins here: How To Move The TabBarView in the Center to The Top of the Page?

Everything is the same as the code given by Griffins.

However, when the tabBar was scrolled to the top and locked there, the content under each widget stopped scrolling too.

I want the content of the widget page to continue scrolling to its end, even when the tabBar is locked at the top.

Even if pinned and floating of SliverPersistentHeader was declared false, all it does is just to make the tabBar scrolled up, the content of the tabBarView still ends at the similar position. This is occurring for both tabBarViews.

So I'm suspecting it has something to do with the sliverfillremaining taking up the remaining height. Is there a way to overcome this? and show all the content of the tabBar?

Solved.

I changed the SliverFillRemaining to

SliverToBoxAdapter(
                child: AnimatedBuilder(
                    animation: tabController.animation,
                    builder: (ctx, child) {
                      if (tabController.index == 0) {
                        return Page1();
                      } else
                        return Page2();
                    }),
              )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM