GooglePayButton constructor

GooglePayButton({
  1. Key? key,
  2. PayProvider buttonProvider = PayProvider.google_pay,
  3. required PaymentConfiguration paymentConfiguration,
  4. void onPaymentResult(
    1. Map<String, dynamic> result
    )?,
  5. required List<PaymentItem> paymentItems,
  6. int cornerRadius = RawGooglePayButton.defaultButtonHeight ~/ 2,
  7. GooglePayButtonTheme theme = GooglePayButtonTheme.dark,
  8. GooglePayButtonType type = GooglePayButtonType.buy,
  9. double width = RawGooglePayButton.minimumButtonWidth,
  10. double height = RawGooglePayButton.defaultButtonHeight,
  11. EdgeInsets margin = EdgeInsets.zero,
  12. VoidCallback? onPressed,
  13. void onError(
    1. Object? error
    )?,
  14. Widget? childOnError,
  15. Widget? loadingIndicator,
})

Implementation

GooglePayButton({
  super.key,
  super.buttonProvider = PayProvider.google_pay,
  required final PaymentConfiguration paymentConfiguration,
  super.onPaymentResult,
  required List<PaymentItem> paymentItems,
  int cornerRadius = RawGooglePayButton.defaultButtonHeight ~/ 2,
  GooglePayButtonTheme theme = GooglePayButtonTheme.dark,
  GooglePayButtonType type = GooglePayButtonType.buy,
  super.width = RawGooglePayButton.minimumButtonWidth,
  super.height = RawGooglePayButton.defaultButtonHeight,
  super.margin = EdgeInsets.zero,
  VoidCallback? onPressed,
  super.onError,
  super.childOnError,
  super.loadingIndicator,
})  : assert(width >= RawGooglePayButton.minimumButtonWidth),
      assert(height >= RawGooglePayButton.defaultButtonHeight),
      super(paymentConfiguration: paymentConfiguration) {
  _googlePayButton = RawGooglePayButton(
      paymentConfiguration: paymentConfiguration,
      cornerRadius: cornerRadius,
      theme: theme,
      type: type,
      onPressed: _defaultOnPressed(onPressed, paymentItems));
}