flutter - 如何在操作栏上有两个搜索栏?

标签 flutter dart android-actionbar appbar

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

enter image description here

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

enter image description here

 @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")],
          )
        ],
      )),
    ));
  }

最佳答案

如何尝试这样的事情...尽管您将不得不完成设计

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)
            ],
          )
        ],
      ),
    ),
  )

输出量

enter image description here

关于flutter - 如何在操作栏上有两个搜索栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60788852/

相关文章:

dart - Flutter 和 Dart 插件 Android Studios

firebase - pubspec.yaml : Expected a key while parsing a block mapping when adding cloud_firestore

flutter - 滚动条未显示flutter web

flutter - 在抖动中出现空错误时调用了PhotoURL

android - 操作栏图标叠加

flutter - 在 flutter 中使用 showDialog 会引发错误 - "' !_debugLocked' : is not true. "

templates - 当 <template if ='...' > 最终实例化为 Dart Polymer 中的 DOM 时如何设置回调

带字幕的Android自定义弹出菜单

单击项目时的Android操作栏自定义下拉 View

android - Flutter Audioplayer APK版本不起作用