[Flutter]OutlinedButtonを「円」にする方法

Flutter

どうも、ちょげ(@chogetarou)です。

OutlinedButtonを「円」にする方法を紹介します。

スポンサーリンク

方法

インターフェース, インターネット, プログラム, ブラウザ, Www

OutlinedButtonを円にするには、「OutlinedButton.styleFrom」を使います。

  1. OutlinedButtonの引数「style」に「OutlinedButton.styleFrom」を指定
  2. 指定した「OutlinedButton.styleFrom」でサイズの設定
  3. 指定した「OutlinedButton.styleFrom」の引数「shape」に「CircleBorder()」を指定
OutlinedButton(
  style: OutlinedButton.styleFrom(
    minimumSize: Size(100, 100), //サイズ
    shape: CircleBorder(), //円
  ),
  onPressed: () {},
  child: Text('Button'),
)

コメント

タイトルとURLをコピーしました