搜索栏将结果加载到新用户界面

问题描述

当我尝试在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 (将#修改为@)