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) {
},
),
得到这个:
预期:
使用-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] 删除。
我来说两句