美文网首页
flutter 装饰器decoration

flutter 装饰器decoration

作者: kot_flu | 来源:发表于2019-03-24 10:07 被阅读0次

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

相关文章

网友评论

      本文标题:flutter 装饰器decoration

      本文链接:https://www.haomeiwen.com/subject/gabyvqtx.html