どうも、ちょげ(@chogetarou)です。
OutlinedButtonを「円」にする方法を紹介します。
方法

OutlinedButtonを円にするには、「OutlinedButton.styleFrom」を使います。
- OutlinedButtonの引数「style」に「OutlinedButton.styleFrom」を指定
- 指定した「OutlinedButton.styleFrom」でサイズの設定
- 指定した「OutlinedButton.styleFrom」の引数「shape」に「CircleBorder()」を指定
OutlinedButton(
style: OutlinedButton.styleFrom(
minimumSize: Size(100, 100), //サイズ
shape: CircleBorder(), //円
),
onPressed: () {},
child: Text('Button'),
)

コメント