ilBarra
ilBarra

Reputation: 866

In Flutter, How can I change TextFormField validation error message style?

I want to set a bigger font size for error message validation in TextFormField but I don't know how.

Upvotes: 40

Views: 39876

Answers (2)

Ebuzer SARIYERLİOĞLU
Ebuzer SARIYERLİOĞLU

Reputation: 818

You can use the TextFormField's property 'decoration' like that.

TextFormField( 
  decoration: InputDecoration(
    errorStyle: TextStyle(
      fontSize: 15,
      color: Colors.red,
      fontWeight: FontWeight.w600
    ),
  ),
)

Upvotes: 1

Andrii Turkovskyi
Andrii Turkovskyi

Reputation: 29438

For this you have to use InputDecoration

TextFormField(
  decoration: InputDecoration(
    errorStyle: TextStyle(
      fontSize: 16.0,
    ),
  ),
  ...
)

Upvotes: 101

Related Questions