zoukankan      html  css  js  c++  java
  • 19.8.22 自定义了一个输入框

    系统提供的输入框还是有很多坑的,比如无法改变边框的粗细和颜色等。所以只能自己自定义一个了

    已下附上代码:

    Widget _textFieldWidget() {
        return Container(
          margin: EdgeInsets.only(top: 50),
          height: 50,
           ScreenUtil.screenWidthDp - 90,
          decoration: BoxDecoration(
              color: Colors.grey[200],
              borderRadius: BorderRadius.all(Radius.circular(10)),
              border: Border.all( 1, color: Colors.grey[300])),
          child: Row(
            children: <Widget>[
              Container(
                margin: EdgeInsets.only(left: 10, right: 10),
                child: Icon(Icons.phone),
              ),
              Container(
                child: Expanded(
                    child: TextField(
                  onSubmitted: (text) {
                    print('提交:' + text);
                  },
                  onChanged: (String text) {
                    print('改变了:' + text);
                  },
                  decoration: InputDecoration.collapsed(
                    hintText: '请输入您的手机号',
                  ),
                )),
              )
            ],
          ),
        );
      }

    已下是效果

  • 相关阅读:
    第一次被队友说给力
    An Unfair Game-[ACdream1035]
    男人八题解题报告
    it's hard to say
    剪花布条[HDU2087]
    1117: 无序字母对 character
    20181101
    20181104
    20181102
    20181031
  • 原文地址:https://www.cnblogs.com/110-913-1025/p/11395572.html
Copyright © 2011-2022 走看看