0

I cant figure out how to use a tabbarview inside of a customscrollview that requires slivers for children. I have tried to wrap the tabbar view in anything i could think of but no luck so far.

desired result | desired result with sliverappbar closed on scroll

here is code that gives the desired look, but is not tab bar controllable

return Scaffold(
  backgroundColor: kBackgroundGrey,
  body: Padding(
    padding: EdgeInsets.only(top: statusBarHeight),
    child: CustomScrollView(
      slivers: [
        const MainMenuSliverAppBar(),
        MainMenuSliverTabBar(
          topTabContrlr: _tabControllerTop,
        ),
        const MainMenuProductSliverGrid()
      ],
    ),
  ),
  bottomNavigationBar: BottomChoiceTab(
    botTabController: _tabControllerBot,
  ),
);

here is my attempt that fails to work for controlling silver grid with tab bar failed attempt

    return Scaffold(
  backgroundColor: kBackgroundGrey,
  body: Padding(
    padding: EdgeInsets.only(top: statusBarHeight),
    child: CustomScrollView(
      slivers: [
        const MainMenuSliverAppBar(),
        MainMenuSliverTabBar(
          topTabContrlr: _tabControllerTop,
        ),
        SliverFillRemaining(
          child: TabBarView(controller: _tabControllerTop, children: const [
            MainMenuProductSliverGrid(),
            MainMenuProductSliverGrid(),
            MainMenuProductSliverGrid(),
            MainMenuProductSliverGrid()
          ]),
        )
      ],
    ),
  ),
  bottomNavigationBar: BottomChoiceTab(
    botTabController: _tabControllerBot,
  ),
);

any help would be greatly appreciated, even if you could just point me in the right direction. I haven't been able to find anything on StackOverflow, google, etc. my failed attempt code is from the closest solution I could find to my problem but it seems even that doesn't work.

plz save me lol

sergedawg
  • 1
  • 3
  • turns out im braindead, this was solved by using a nested scroll view and playing around with the sliver app bar options. – sergedawg Aug 25 '22 at 01:33
  • You may need to take a look at this answer https://stackoverflow.com/questions/68640078/tabbarview-inside-sliver-with-stickyheader – Adam Ghando Dec 27 '22 at 18:09

0 Answers0