@@ -17,6 +17,7 @@ class ApplePayButton extends StatelessWidget {
1717 Key ? key,
1818 this .style = ApplePayButtonStyle .black,
1919 this .type = ApplePayButtonType .plain,
20+ this .cornerRadius = 4.0 ,
2021 this .onPressed,
2122 double ? width,
2223 double ? height = _kApplePayButtonDefaultHeight,
@@ -42,6 +43,11 @@ class ApplePayButton extends StatelessWidget {
4243 /// Default is [ApplePayButtonType.plain] .
4344 final ApplePayButtonType type;
4445
46+ /// Modifies the **corner radius** of the payment button.
47+ /// To remove the rounded courners, set this value to 0.0.
48+ /// The default value is set to 4.0
49+ final double cornerRadius;
50+
4551 /// Callback that is executed when the button is pressed.
4652 final VoidCallback ? onPressed;
4753
@@ -62,6 +68,7 @@ class ApplePayButton extends StatelessWidget {
6268 return _UiKitApplePayButton (
6369 type: type,
6470 style: style,
71+ cornerRadius: cornerRadius,
6572 onPressed: onPressed,
6673 );
6774 default :
@@ -76,11 +83,13 @@ class _UiKitApplePayButton extends StatefulWidget {
7683 Key ? key,
7784 this .style = ApplePayButtonStyle .black,
7885 this .type = ApplePayButtonType .plain,
86+ this .cornerRadius = 4.0 ,
7987 this .onPressed,
8088 }) : super (key: key);
8189
8290 final ApplePayButtonStyle style;
8391 final ApplePayButtonType type;
92+ final double cornerRadius;
8493 final VoidCallback ? onPressed;
8594 @override
8695 _UiKitApplePayButtonState createState () => _UiKitApplePayButtonState ();
@@ -97,7 +106,11 @@ class _UiKitApplePayButtonState extends State<_UiKitApplePayButton> {
97106 return UiKitView (
98107 viewType: 'flutter.stripe/apple_pay' ,
99108 creationParamsCodec: const StandardMessageCodec (),
100- creationParams: {'type' : type, 'style' : style},
109+ creationParams: {
110+ 'type' : type,
111+ 'style' : style,
112+ 'cornerRadius' : widget.cornerRadius
113+ },
101114 onPlatformViewCreated: (viewId) {
102115 methodChannel = MethodChannel ('flutter.stripe/apple_pay/$viewId ' );
103116 methodChannel? .setMethodCallHandler ((call) async {
0 commit comments