どうも、ちょげ(@chogetarou)です。
DropdownButtonFormFieldのテキストの色を設定する方法を紹介します。
方法

DropdownButtonFormFieldのテキストの色を設定するには、引数「style」を使います。
まず、DropdownButtonFormFieldの引数「style」にTextStyleを指定します。
そして、TextStyleの引数「color」にテキストの色を指定をします。
DropdownButtonFormField(
style: TextStyle(
color: /*テキストの色*/,
),
value: _text,
items: [
・・・
],
onChanged: (String? value) {
・・・
},
),
引数「style」を使えば、DropdownButtonFormFieldのテキストの色を設定することが出来ます。
使用例
以下は、使用例です。

DropdownButtonFormField(
style: TextStyle(
color: Colors.pink,
),
value: _text,
items: [
DropdownMenuItem(
child: Text('Hello'),
value: 'Hello',
),
DropdownMenuItem(
child: Text('Hola'),
value: 'Hola',
),
DropdownMenuItem(
child: Text('こんにちは'),
value: 'こんにちは',
),
],
onChanged: (String? value) {
setState(() {
_text = value ?? 'Hello';
});
},
),

[Flutter]DropdownButtonFormFieldの有効時のアイコンの色を設定するには?
DropdownButtonFormFieldが有効な時のアイコンの色を設定する方法を紹介します。

[Flutter]DropdownButtonのアイコンの色を変えるには?
DropdownButtonのアイコンの色を変える方法を紹介します。

[Flutter]DropdownButtonの背景色を変えるには?
DropdownButtonの背景色を変える方法を紹介します。

[Flutter]DropdownButtonFormFieldの装飾を設定するには?
DropdownButtonFormFieldの装飾を設定する方法を紹介します。
コメント