dart - 分隔线和行之间的填充很大
问题描述
我有一个编辑文本和图标..我想在它们下面有一条线..所以我在它们后面添加了一个分隔线,如下所示:
new Column(
children: <Widget>[
new Row(
children: <Widget>[
new Image.asset(
'assets/sa-logo.png',
width: 20.0,
height: 13.0,
),
Padding(
padding: EdgeInsets.only(left: 5.0, right: 5.0),
child: new Text(
'+966',
style: TextStyle(
fontSize: 15.0, color: Colors.grey),
),
),
new Flexible(
child: new TextField(
style: new TextStyle(
fontSize: 20.0,
color: Colors.black,
),
decoration: new InputDecoration(
border: InputBorder.none,
hintText: '5xxxxxxxx',
hintStyle: new TextStyle(
fontSize: 20.0,
),
),
keyboardType: TextInputType.number,
onChanged: (String value) {
this._data.phone = value;
setState(() {
phonelength = value.length;
done();
});
}),
),
],
),
Divider()
],
),
但是线和其他小部件之间的空间很大,如图所示:
如何让它变小?
解决方案
我刚刚将其添加到TextField
:
contentPadding: EdgeInsets.symmetric(vertical: 0),
这解决了问题。
推荐阅读
- r - R 检查组内的级别,如果不存在则重复行
- javascript - 如何使用 JS 在数组中声明数组索引值?
- c# - .NET Core 2.2 程序集 System.Windows.Forms 缺失
- serial-port - USB <> 串行(COM)端口响应时间
- html - 如何在同一个 ng-click 中添加谷歌分析
- unix - 在 unix 中将字符串 Fri, 04 Aug 2017 13:07:44 转换为 04-08-2017
- c# - 具有多个不同 Text 元素的 XML 元素
- python - 我想用一行代码。列表理解
- python - python - 如何从另一个目录中的子包导入python子目录中的文件?
- c# - 当服务中的事件被触发时,如何将响应从服务发送回客户端?