flutter-plugin
flutter-plugin copied to clipboard
[PR] Add cornerRadius to ApplePayButtonView
Hello,
We can customize the Apple Pay Button with a cornerRadius (by default set to 4.0)
So to do this we need to add when create the button :
let buttonType = arguments["type"] as! String
let buttonStyle = arguments["style"] as! String
let cornerRadius = arguments["cornerRadius"] as! CGFloat
then create the button with this method :
createApplePayView(type: buttonType, style: buttonStyle, cornerRadius: cornerRadius)
and finally customize it only when available iOS 12 minimum :
// Create the PK objects
let paymentButtonType = PKPaymentButtonType.fromString(buttonTypeString) ?? .plain
let paymentButtonStyle = PKPaymentButtonStyle.fromString(buttonStyleString) ?? .black
let applePayButton = PKPaymentButton(paymentButtonType: paymentButtonType, paymentButtonStyle: paymentButtonStyle)
if #available(iOS 12.0, *) {
applePayButton.cornerRadius = cornerRadius
}
Hi @AymenFarrah, thank you for the suggestion. Feel free to suggest a PR with the changes and we'll take a look. If you are not able to do so, let us know too.
Related to https://github.com/google-pay/flutter-plugin/issues/32
Hi @AymenFarrah, thank you for the suggestion. Feel free to suggest a PR with the changes and we'll take a look. If you are not able to do so, let us know too.
Hi @JlUgia ! I'm trying to open a new pull request based from main but Create pull request button is disabled.
Hello @AymenFarrah, PRs are accepted from external forks. Please take a look at the contribution guide before proposing any changes.
Published under 1.2.0-beta02
.