【问题标题】:How to have two search bar on action bar?如何在操作栏上有两个搜索栏?
【发布时间】:2020-07-02 10:59:13
【问题描述】:

实现如下图的正确方法是什么?

我在 appBar 中添加了列和行,但是得到了这个

 @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: PreferredSize(
      preferredSize: Size.fromHeight(150.0),
      child: AppBar(
          title: Column(
        children: <Widget>[
          Row(children: <Widget>[Icon(Icons.access_alarm), Text("idwidjow")]),
          SizedBox(
            height: 20,
          ),
          Row(
            children: <Widget>[Icon(Icons.access_alarm), Text("idwidjow")],
          )
        ],
      )),
    ));
  }

【问题讨论】:

    标签: flutter dart android-actionbar appbar


    【解决方案1】:

    尝试这样的事情怎么样...不过你必须完成设计

    appBar: PreferredSize(
        preferredSize: Size.fromHeight(150.0),
        child: AppBar(
          flexibleSpace: Column(
            children: <Widget>[
              Row(
                children: <Widget>[
                  Container(
                    child: Icon(Icons.arrow_back),
                    width: 50,
                  ),
                  Icon(Icons.person),
                  Flexible(
                      child: TextField(
                          decoration: InputDecoration(
                    border: OutlineInputBorder(
                      borderRadius: BorderRadius.all(Radius.circular(12.0)),
                    ),
                  ))),
                  Icon(Icons.arrow_back)
                ],
              ),
              Row(
                children: <Widget>[
                  SizedBox(width: 50),
                  Icon(Icons.person),
                  Flexible(
                      child: TextField(
                    decoration: InputDecoration(
                      border: OutlineInputBorder(
                        borderRadius: BorderRadius.all(Radius.circular(12.0)),
                      ),
                    ),
                  )),
                  Icon(Icons.arrow_back)
                ],
              )
            ],
          ),
        ),
      )
    

    输出

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多