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
You can also change its color by following ways.
Wrap your TextField in Theme and provide accentColor
Theme(
data: Theme.of(context).copyWith(accentColor: Colors.red),
child: TextField(),
)
Using inputDecoration property.
TextField(
decoration: InputDecoration(
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.red),
),
),
)