どうも、ちょげ(@chogetarou)です。
TextFormFieldがバリデーションエラーを起こした時に表示されるテキストの色を設定する方法を紹介します。
方法

TextFormFieldのバリデーションエラーのテキストカラーを設定するには、InputDecorationを使います。
まず、TextFormFieldの引数「decoration」にInputDecorationを指定します。
次に、InputDecorationの引数「errorStyle」にTextStyleを指定します。
そして、TextStyleの引数「color」にエラーテキストの色を指定します。
TextFormField(
decoration: InputDecoration(
errorStyle: TextStyle(
color: /*エラーテキストの色*/,
),
),
),
これでTextFormFieldのエラーテキストの色を設定することが出来ます。
使用例
以下は、使用例です。

TextFormField(
decoration: InputDecoration(
errorStyle: TextStyle(
color: Colors.blue,
),
),
validator: (value) => 'Error Message',
),

[Flutter]TextFormFieldの左側にアイコンを表示するには?
TextFormFieldの左側にアイコンを表示する方法を紹介します。

[Flutter]TextFormFieldの右側にアイコンを表示するには?
TextFormFieldの右側にアイコンを表示する方法を紹介します。

[Flutter]DatePickerでTextFormFieldに入力するには?
DatePickerでTextFormFieldに入力するには、どうしたらいいのでしょうか?

[Flutter]TextFormFieldウェジェッに初期値を設定する方法
TextFormFieldウェジェットに「初期値」を設定する方法を紹介します。
コメント