felixmccuaig / flutter-autocomplete-textfield

An autocomplete Textfield for flutter
MIT License
181 stars 131 forks source link

How to change text field color. #23

Closed fazil-augr closed 5 years ago

fazil-augr commented 5 years ago

I want to change the text field color. I tried so methods. No one working

searchTextField = AutoCompleteTextField<Keyword>(
    style: new TextStyle(color: Colors.black, fontSize: 18.0),
                       decoration:  new InputDecoration(
                         border: InputBorder.none,
                         fillColor: Colors.red,
          )

)

Is there any solution?

hbdejesus commented 5 years ago

You what you mean by color is the fillColor, you need to set the "filled" property of InputDecoration to true.

Ex. new TextStyle(color: Colors.black, fontSize: 18.0), decoration: new InputDecoration( border: InputBorder.none, filled: true, fillColor: Colors.red, )

Edit: Link to InputDecoration documentation https://docs.flutter.io/flutter/material/InputDecoration-class.html

fazil-augr commented 5 years ago

After clean and rebuild it is working fine. I don't know why it is not working in previous. It is not working in hot reload also. Any way thanks my problem solved.