I have a TextField()
, I want to change the Underlineinput border color and the thickness of it since it looks to the thickness. I have tried my level to change it but it is not at all working.
I have followed these links but nothing worked for me :
Tried so far is :
CODE:
decoration: InputDeocration(
border: UnderlineInputBorder(
borderSide: new BorderSide(
color: Color.fromRGBO(173, 179, 191, 1),
width: 0.5,
style: BorderStyle.none
)
)
)
The only thing that works or changes the color here is for the focussedBorder
and enabledBorder
. I don't want this, so I'm looking forward to getting some good advice here.
It doesn't change anything. What I want is :
What I'm getting so far is this every time irrespective of the changes I make to the design :
To add a border to a TextField/TextFormField in Flutter, you can specify the decoration property and then use the InputDecoration and OutlineInputBorder widget. The OutlineInputBorder widget has the borderSide widget which you can use to pass in the BorderSide widget with width and color parameter to create the border.
In short, to change the hint color, set hintColor using Theme and ThemeData.
You can change the Underlineinput border color
and the thickness
Using the
enabledBorder and focusedBorder properties.
TextField(
decoration: InputDecoration(
enabledBorder: UnderlineInputBorder(borderSide: BorderSide(color: Colors.red,width: 2.0)),
focusedBorder: UnderlineInputBorder(borderSide: BorderSide(color: Colors.teal,width: 5.0)),
labelText: 'Your Email or Phone'
)
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With