どうも、ちょげ(@chogetarou)です。
ボタンの種類を紹介します。
種類

ボタンの種類は、約7種類ほどあります。(他にも細かいのがいくつかあります)
- ElevatedButton:影付きのボタン
- TextButton:テキストボタン
- Icon Button : アイコンボタン
- Cupertino Button : iOS風のボタン
- FloatingActionButton : フローティングボタン
- Drop Down Button : ドロップダウンボタン
- PopUpMenu Button : ポップアップメニューボタン
頻出
使う頻度が多いのは、ElevatedButton、TextButton、IconButton、FloatingActionButtonの4つです。
ElevatedButton

ElevatedButtonは、影と背景色の付いたボタンです。
ElevatedButton(
onPressed: () {},
child: Text('Button'),
)
TextButton

TextButtonは、名前通りテキストのボタンです。
TextButton(
onPressed: () {},
child: Text('Button'),
),
IconButton

IconButtonは、アイコンのボタンです。
IconButton(
onPressed: () {},
icon: Icon(Icons.settings),
)
Floating Action Button

FloatingActionButtonは、特殊なボタンです。
このボタンは、Scaffoldというウェジェットで使われ、画面の右下に配置されるようになっています。
FloatingActionButton(
onPressed: () {},
child: Icon(Icons.add),
)
最後に
ここまで読んで頂きありがとうございました。
参考になれば嬉しいです。
もし、この記事に不備があったら、教えてくださるとありがたいです。
では、サラダバー!
コメント