装饰器decoration笔记
decoration: InputDecoration(
//输入框decoration属性
// contentPadding: const EdgeInsets.symmetric(vertical: 4.0,), //调整文字跟外面边框的留白,垂直上下方向
// contentPadding: const EdgeInsets.symmetric(horizontal: 4.0,), //调整文字跟外面边框的留白,水平左右方向
contentPadding: new EdgeInsets.only(
left: 10.0, top: 10.0, right: 5.0, bottom: 10.0),
//特定方向留白
fillColor: Color(0xffffffff),
// fillColor: Colors.blue,
filled: true,
border: InputBorder.none,
//下边框
hintText: "we are glad to hear from you",
hintStyle:
new TextStyle(fontSize: 14, color: Color(0xff777777))),
这里需要注意 padding 里面的几个用法,控制着各个方向的间距
EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 20.0)
contentPadding: const EdgeInsets.symmetric(vertical: 4.0,), //调整文字跟外面边框的留白,垂直上下方向
contentPadding: const EdgeInsets.symmetric(horizontal: 4.0,), //调整文字跟外面边框的留白,水平左右方向
contentPadding: new EdgeInsets.only( left: 10.0, top: 10.0, right: 5.0, bottom: 10.0),
网友评论