在CustomScrollView中显示TabBarView

时间:2020-09-10 14:42:53

标签: flutter dart

我不知道如何在CustomScrollView中显示TabBarView。 我收到错误消息:RenderBox应该存在,但是收到了RenderSliv​​erList类型的子级。 TabBarView的子级是SliverList类型。 有任何想法吗?

child: Scaffold(
        body: SizedBox.expand(
          child: CustomScrollView(
            slivers: [
              SliverAppBar(), //details hidden

              //Here is the problem, _screens are of type SliverList
              //I get the error about renderBox expected but received RenderSliverList
              //I need the TabBarView to work here inside the customSCrollView
              //TabBarView(children: _screens).children[0] works but is not what i want,

              TabBarView(children: _screens),

            ],
          ),
        ),
      ),

0 个答案:

没有答案