どうも、ちょげ(@chogetarou)です。
アイコンのパディングを設定する方法を紹介します。
方法

アイコンのパディングを設定するには、Paddingを使います。
まず、IconウェジェットをPaddingでラップします。
そして、Paddingの引数「padding」にパディングを指定します。
パディングはEgdeInsetsで指定します。
Padding(
padding: /*パディングをEdgeInsetsで指定*/,
child: Icon(Icons.android),
),
これでアイコンのパディングを設定することが出来ます。
使用例
以下は、使用例です。

@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Container(
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Icon(Icons.android),
),
decoration: BoxDecoration(border: Border.all(color: Colors.black)),
),
),
);
}
コメント