Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter change textfield underline Color

Tags:

flutter

dart

I am trying to change the underline color of a textfield when it's inactive/not focused. I am not sure where to make this change, InputDecorationTheme is only changing the underline color for when it's selected. How do I achieve this?

inputDecorationTheme: new InputDecorationTheme(
          labelStyle: new  TextStyle(
              color: Colors.blue[200],
          ),
          hintStyle: new TextStyle(color: Colors.grey),
        ),

I am trying to change this color the textfield to a lighter grey when it's not selected/out of focus.

enter image description here

like image 493
spongyboss Avatar asked May 12 '18 11:05

spongyboss


1 Answers

For those who might need to achieve something similar, change the hintColor in your Theme widget.

new Theme(
          data: new ThemeData(
              //this changes the colour
              hintColor: Colors.grey,
              inputDecorationTheme: new InputDecorationTheme(
                  labelStyle: new TextStyle(color: Colors.blue))));
like image 86
spongyboss Avatar answered Sep 24 '22 14:09

spongyboss