PayButton constructor

PayButton(
  1. Key? key,
  2. PayProvider buttonProvider,
  3. @Deprecated('Prefer to use [paymentConfiguration]. Take a look at the readme to see examples') String? paymentConfigurationAsset,
  4. PaymentConfiguration? paymentConfiguration,
  5. void onPaymentResult(
    1. Map<String, dynamic> result
    ),
  6. double width,
  7. double height,
  8. EdgeInsets margin,
  9. void onError(
    1. Object? error
    )?,
  10. Widget? childOnError,
  11. Widget? loadingIndicator,
)

Initializes the button and the payment client that handles the requests.

Implementation

PayButton(
  Key? key,
  this.buttonProvider,
  @Deprecated('Prefer to use [paymentConfiguration]. Take a look at the readme to see examples')
      final String? paymentConfigurationAsset,
  final PaymentConfiguration? paymentConfiguration,
  this.onPaymentResult,
  this.width,
  this.height,
  this.margin,
  this.onError,
  this.childOnError,
  this.loadingIndicator,
)   : _payClient = paymentConfigurationAsset != null
          ? Pay.withAssets([paymentConfigurationAsset])
          : Pay({buttonProvider: paymentConfiguration!}),
      super(key: key);