どうも、ちょげ(@chogetarou)です。
ElevatedButtonの影の色を変える方法を紹介します。
方法

ElevatedButtonの影の色を変えるには、「ElevatedButton.styleFrom」を使います。
「ElevatedButton.styleFrom」の引数「shadowColor」で影の色を設定することが出来ます。
そして、影の色を設定した「ElevatedButton.styleFrom」を、ElevatedButtonの引数「style」に指定します。
ElevatedButton(
onPressed: () {},
child: Text('Button'),
style: ElevatedButton.styleFrom(
elevation: 8,
shadowColor: Colors.red,
),
)

まとめ
ElevatedButtonの影の色を変更は、ElevatedButton.styleFromの引数「shadowColor」で行います。
影の色を指定した「ElevatedButton.styleFrom」は、ElevatedButtonの引数「style」に指定します。
コメント