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

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

DropdownButton(
style: TextStyle(
color: Colors.red,
),
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の装飾を設定する方法を紹介します。
コメント