我正在尝试在gridview上方显示一个搜索栏(来自流构建器)。希望搜索栏与gridview一起向上滚动。我尝试了多种方法将它们包装在扩展的/灵活的小部件中,但是我总是会遇到错误。有人管理过这个吗?
这就是我现在所拥有的内容,它将滚动但搜索栏位于顶部。
new Column(
children: <Widget>[
new Flexible(
child: new Column(
children: <Widget>[
new Container(
margin: new EdgeInsets.only(left: 4.0, right: 4.0),
color: Colors.white,
child: new Row(
children: <Widget>[
new Container(
margin: new EdgeInsets.only(left: 8.0, right: 8.0, top: 8.0, bottom: 8.0),
child: Icon(Icons.search),
),
new Container(
child: Flexible(
child: new TextField(
onChanged: (String text) {
setState(() {
_searchController.text = text;
});
},
decoration: new InputDecoration.collapsed(hintText: 'Search...'),
controller: _searchController,
),
)
),
],
),
),
new Flexible(
child: new StreamBuilder(
stream: stgDocument.collection('people').orderBy('scroll').snapshots(), …Run Code Online (Sandbox Code Playgroud)