[Flutter]MaterialButtonのテキストの色を設定する方法

Flutter

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

MaterialButtonのテキストの色を設定する方法を紹介します。

スポンサーリンク

方法

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

テキストの色を設定するには、引数「textColor」を使用します。

引数「textColor」に設定した色が、テキストの色になります。

child: MaterialButton(
  color: Colors.blue,
  textColor: Colors.white, //テキストカラー
  child: Text('Button'),
  onPressed: () {},
),

コメント

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