如何解决搜索栏将结果加载到新用户界面
当我尝试在Flutter应用程序中搜索某些内容时出现问题。当我搜索单词时,结果与实际HomepageView中的所有小部件重叠。我如何重定向结果以显示在新页面中。 这是我在homepage.dart用户界面上使用的代码:
body: Stack(children: <Widget>[
SearchBar<Post>(
searchBarPadding: EdgeInsets.symmetric(
horizontal: 10,),headerPadding: EdgeInsets.symmetric(horizontal: 10),listPadding: EdgeInsets.symmetric(horizontal: 10),onSearch: _getALlPosts,searchBarController: _searchBarController,placeHolder: Text(""),cancellationWidget: Text("Cancel"),emptyWidget: Text("empty"),indexedScaledTileBuilder: (int index) =>
ScaledTile.count(1,index.isEven ? 2 : 1),onCancelled: () {
print("Cancelled triggered");
},mainAxisSpacing: 10,crossAxisSpacing: 10,crossAxisCount: 2,onItemFound: (Post post,int index) {
return Container(
color: Colors.lightBlue,child: ListTile(
title: Text(post.title),isThreeLine: true,subtitle: Text(post.body),onTap: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) => Detail()));
},);
},
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。