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