flutter 装饰器decoration

2019-03-24  本文已影响0人  kot_flu

装饰器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),

上一篇下一篇

猜你喜欢

热点阅读