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) {
},
),
得到这个:
预期:
答案 0 :(得分:0)
使用-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) {},
),