You can also change its color by following ways.
-
Wrap your
TextField
inTheme
and provideaccentColor
Theme( data: Theme.of(context).copyWith(accentColor: Colors.red), child: TextField(), )
-
Using
inputDecoration
property.TextField( decoration: InputDecoration( focusedBorder: UnderlineInputBorder( borderSide: BorderSide(color: Colors.red), ), ), )