首页 > 解决方案 > 分隔线和行之间的填充很大

问题描述

我有一个编辑文本和图标..我想在它们下面有一条线..所以我在它们后面添加了一个分隔线,如下所示:

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

但是线和其他小部件之间的空间很大,如图所示:

在此处输入图像描述

如何让它变小?

标签: dartflutter

解决方案


我刚刚将其添加到TextField

contentPadding: EdgeInsets.symmetric(vertical: 0),

这解决了问题。


推荐阅读