我正试着把我的头脑围绕在摆动的UI位置上.所以我现在有一个看起来像这样的东西 个
我想添加一些空格b/w搜索文本字段和按钮.
这就是我的代码的控制部分.我试着设计我的textFieldSearchBox
的样式,让它在右边有一点空白,我试着增加边缘插入,但它似乎增加了TextField的大小,我不知道为什么?我知道可以在TextField之后添加填充元素,但我想知道我的其他选项是什么.为什么在textFieldSearchBox的修饰中增加EdgeInsets会增加文本框的大小?我的理想情况是在此文本框(LTRB)的所有边框周围添加边距.
有什么建议吗?
TextField textFieldSearchBox = new TextField(
keyboardType: TextInputType.text,
controller: filterController,
autofocus: false,
decoration: new InputDecoration(
contentPadding: new EdgeInsets.fromLTRB(20.0, 10.0, 100.0, 10.0),
border:
new OutlineInputBorder(borderRadius: BorderRadius.only()),
),
);
var optionRow = new Row(
children: <Widget>[
new Expanded(child:textFieldSearchBox),
searchButton,
new IconButton(
icon: new Icon(Icons.filter),
onPressed: (){print("Called....");},
),
],
);
return new Scaffold(
appBar: new AppBar(
title: new Text("Title goes here.."),
backgroundColor: Colors.lightBlueAccent,
),
body: new Container(
child:new Column(
children: <Widget>[
optionRow,
],
),
),
);