简体   繁体   中英

How to invert the color of TextFormField in flutter?

I changed my application color. However TextFormField have got very invisible. Are there any way to modify the TextFormField as it is better.

Thanks.

you can change the style and fill color to make it fit with the current theme:

TextFormField(
        style: someTextStyle,
        decoration: InputDecoration(
          hintStyle:someTextStyle
          fillColor: someColor,
          filled: true,
        ),
      )

LoVe is correct. There are constructors for the TextFormField class that you can use here: Flutter documentation . Another example:

TextFormField(
              decoration: InputDecoration(
                filled: true,
                fillColor: Colors.lightBlue[50],
                border: OutlineInputBorder(),
                icon: Icon(Icons.person),
                hintText: 'What do people call you?',
                labelText: 'Name',
              ),
              onSaved: (String value) {
                // This optional block of code can be used to run
                // code when the user saves the form.
              },
            ),

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM