Reputation: 7928
InputDecoration
is not showing underline below icon in 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) {
},
),
getting this:
Expected:
Upvotes: 3
Views: 2104
Reputation: 51236
use - prefixIcon:
instead of 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) {},
),
Upvotes: 5