颤振:TextFormField图标下方的下划线

法哈纳

InputDecoration 未在中的图标下方显示下划线 TextFormField

            TextFormField(
                          obscureText: true,
                          style: TextStyle(color: Colors.white),
                          keyboardType: TextInputType.text,
                          //validator: validatePassword,
                          decoration: InputDecoration(
                              icon: Icon(Icons.lock_outline,color: Colors.white,),
                              labelStyle: new TextStyle(color: Colors.white),
                              enabledBorder: UnderlineInputBorder(
                                  borderSide: new BorderSide(color: Colors.white)),
                              hintStyle: new TextStyle(
                                inherit: true,
                                fontSize: 18.0,
                                fontFamily: "WorkSansLight",
                                color: Colors.white,
                              ),
                              hintText: 'PASSWORD'),
                          onSaved: (String val) {

                          },
                        ),

得到这个:

在此处输入图片说明

预期:

在此处输入图片说明

Anmol.majhail

使用-prefixIcon:代替icon

TextFormField(
          obscureText: true,

          style: TextStyle(color: Colors.white),
          keyboardType: TextInputType.text,
          //validator: validatePassword,
          decoration: InputDecoration(
            prefixIcon: Icon(
              Icons.lock_outline,
              color: Colors.white,
            ),
              labelStyle: new TextStyle(color: Colors.white),
              enabledBorder: UnderlineInputBorder(
                  borderSide: new BorderSide(color: Colors.white)),
              hintStyle: new TextStyle(
                inherit: true,
                fontSize: 18.0,
                fontFamily: "WorkSansLight",
                color: Colors.white,
              ),
              hintText: 'PASSWORD'),
          onSaved: (String val) {},
        ),

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章