背景色を変更する|FilledButton|Flutter 3.27.4

FilledButton のデフォルトは、プライマリ・カラーになっています。

マテリアル・デザイン的には、そのまま使うのが推奨だと思います…が、変更したい場合もあるでしょう。

FilledButton(
  style: FilledButton.styleFrom(
    backgroundColor: Colors.red,
  ),
);

関連

参考

【Flutter】ボタンの色の変え方【 MaterialStateProperty 】
Flutter入門:ElevatedButtonの背景色を変更する方法
【Flutter】ElevatedButtonの背景色・前景色を変更
【Flutter】ElevatedButtonのデザイン例(サイズ、背景色、形状、枠線)

コメント

このブログの人気の投稿

Breaking Taboos and Reaching 100K Downloads: The Journey and Future of the Masturbation Tracker App "Ei Nano"