Home > Back-end >  how to change TextFormField hint label background color in flutter
how to change TextFormField hint label background color in flutter

Time:09-17

How to change TextFormField hint label background color in flutter?

enter image description here

CodePudding user response:

You can use backgroundColor propetry of TextStyle to change the background color of labelText or hintText:

TextFormField(
  decoration: const InputDecoration(
    hintText: 'Hint Text',
    labelText: 'Label Text',
    hintStyle: TextStyle(
      backgroundColor: Colors.red, // Change background color for hint text
    ),
    labelStyle: TextStyle(
      backgroundColor: Colors.blue, // Change background color for label text
    ),
  ),
)

CodePudding user response:

You can edit the hintStyle of InputDecoration

  • Related