Getting 'Horizontal viewport was given unbounded height.' with TabBarView in flutter

后端 未结 4 2095
一生所求
一生所求 2021-01-01 14:45

I\'m trying to make a profile page, where the users info is at the top. And then have a tab view below that for different views.

This is the code I\'m using

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-01 15:06

    I solved it by adding TabBar inside Container and TabBarView inside Expanded:

    DefaultTabController(
        length: 3,
        child: Column(
          children: [
            Container(child: TabBar(..)),
            Expanded(child: TabBarView(..)),
          ],
        ),
      );
    

提交回复
热议问题