Flutter アイコン付きのTextButtonを表示するサンプル

環境
Windows11 pro 64bit
Flutter 3.3.7

構文

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
icon: Icon(アイコン), //アイコン
label: Text('文字列'), //テキスト
icon: Icon(アイコン), //アイコン label: Text('文字列'), //テキスト
icon: Icon(アイコン), //アイコン
label: Text('文字列'), //テキスト

TextButton.icon()の引数「icon」にアイコン、引数「label」に「テキスト」を指定します。
アイコン付きのテキストボタンを表示するには、「iconコンストラクタ」を使います。

使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
TextButton.icon(
onPressed: () {},
icon: Icon(Icons.update),
label: Text('更新'),
)
TextButton.icon( onPressed: () {}, icon: Icon(Icons.update), label: Text('更新'), )
TextButton.icon(
    onPressed: () {},
    icon: Icon(Icons.update),
    label: Text('更新'),
  )

 

Flutter

Posted by arkgame