I'm working on an application using Flutter SDK. When I use a TextField
widget, and I focus it, the underline becomes blue. I need to change this color to red, how can I do it?
Screenshot of what I need to change. I want just the underline to change, , not the label color.
Best Answer
While these other answers may somehow work, you should definitely not use it. That's not the proper way to get a custom theme in Flutter.
A much more elegant solution is as followed :
At the same time, if you just want to show an error (Red), use
errorText
ofInputDecoration
instead. It will automatically set the color to red.