Flutter Materialを使ってアイコン(icon)の形を指定する方法

環境
Windows11 pro 64bit
Flutter 3.3.7

構文
Material(
shape: CircleBorder(), //引数「shape」に形を指定する
child: Icon(
xxx //ContainerをMaterialのchildに指定する
Materialを使ってアイコン(Icon) の形を指定します。

使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Material(
shape: CircleBorder(),
child: Icon(
Icons.flutter_dash,
color: Colors.white,
size: 80,
),
color: Colors.green,
)
Material( shape: CircleBorder(), child: Icon( Icons.flutter_dash, color: Colors.white, size: 80, ), color: Colors.green, )
 Material(
  shape: CircleBorder(),
  child: Icon(
    Icons.flutter_dash,
    color: Colors.white,
    size: 80,
  ),
  color: Colors.green,
)

 

Flutter

Posted by arkgame