[Flutter]OutlinedButtonの背景色を変える方法

Flutter

どうも、ちょげ(@chogetarou)です。

OutlinedButtonの背景色を変える方法を紹介します。

スポンサーリンク

方法

インターフェース, インターネット, プログラム, ブラウザ, Www

OutlinedButtonの背景色を変えるには、「OutlinedButton.styleFrom」を使います。

「OutlinedButton.styleFrom」の引数「backgroundColor」で、背景色を設定します。

そして、OutlinedButtonの引数「style」に、背景色を設定した「OutlinedButton.styleFrom」を指定します。

child: OutlinedButton(
  onPressed: () {},
  child: Text('Button'),
  style: OutlinedButton.styleFrom(
    backgroundColor: Colors.yellow, //背景色
  ),
),

コメント

タイトルとURLをコピーしました