AppBar中的字幕

时间:2018-07-22 08:27:23

标签: dart flutter

我有一个带有标题和副标题的SliverAppBar,如下所示:

null

它运行,但是如果我滚动,则会收到此错误:

SliverAppBar(
                  backgroundColor: Colors.white,
                  forceElevated: true,
                  elevation: 1.0,
                  pinned: true,
                  floating: true,
                  snap: false,
                  title: Column(
                    children: <Widget>[
                    Container(padding: EdgeInsets.only(top: 6.0, bottom: 5.0),
                      child: Text('Contest', style: TextStyle(color: Colors.black, fontWeight: FontWeight.w500))),
                    Text(_getFiltersString(), style: TextStyle(fontSize: 14.0, color: Colors.grey[700]),)
                  ]),

我必须使用什么来代替Column?

谢谢

1 个答案:

答案 0 :(得分:0)

这意味着小部件大于视图。现在,您可以将Column包裹在SingleChildScrollView中以使其滚动:

SingleChildScrollView( child: Column(...) )
相关问题