どうも、ちょげ(@chogetarou)です。
ButtonStyleの引数「shape」を使う方法を紹介します。
方法

ButtonStyleの引数「shape」を使うには、MaterialStatePropertyクラスを指定します。
具体的には、「MaterialStateProperty.all<クラス>(クラス)」のように指定します。
MaterialStatePropertyStateクラスに指定するクラスは、実際の形を指定するためのものです。
例えば、角丸の四角形の形を指定するRoundedRectangleBorderクラスの場合は、次のようになります。
MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
),
まとめ
ButtonStyleの引数「shape」を使うには、MaterialStatePropertyクラスを使って形を指定します。
コメント