PayButton constructor

PayButton({
  1. Key? key,
  2. required PayProvider buttonProvider,
  3. required PaymentConfiguration paymentConfiguration,
  4. void onPaymentResult(
    1. Map<String, dynamic> result
    )?,
  5. double width = 0,
  6. double height = 0,
  7. EdgeInsets margin = const EdgeInsets.all(0),
  8. void onError(
    1. Object? error
    )?,
  9. Widget? childOnError,
  10. Widget? loadingIndicator,
})

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

Implementation

PayButton({
  super.key,
  required this.buttonProvider,
  required final PaymentConfiguration paymentConfiguration,
  this.onPaymentResult,
  this.width = 0,
  this.height = 0,
  this.margin = const EdgeInsets.all(0),
  this.onError,
  this.childOnError,
  this.loadingIndicator,
}) : _payClient = Pay({buttonProvider: paymentConfiguration});