PaymentElement constructor

PaymentElement({
  1. required CardChangedCallback onCardChanged,
  2. Key? key,
  3. CardFocusCallback? onFocus,
  4. CardStyle? style,
  5. CardPlaceholder? placeholder,
  6. bool enablePostalCode = false,
  7. double? width,
  8. double? height = kCardFieldDefaultHeight,
  9. BoxConstraints? constraints,
  10. FocusNode? focusNode,
  11. required String clientSecret,
  12. bool autofocus = false,
  13. PaymentElementLayout layout = PaymentElementLayout.accordion,
  14. ElementAppearance? appearance,
})

Implementation

PaymentElement({
  required this.onCardChanged,
  Key? key,
  this.onFocus,
  this.style,
  this.placeholder,
  this.enablePostalCode = false,
  double? width,
  double? height = kCardFieldDefaultHeight,
  BoxConstraints? constraints,
  this.focusNode,
  required this.clientSecret,
  this.autofocus = false,
  this.layout = PaymentElementLayout.accordion,
  this.appearance,
})  : assert(constraints == null || constraints.debugAssertIsValid()),
      constraints = (width != null || height != null)
          ? constraints?.tighten(width: width, height: height) ??
              BoxConstraints.tightFor(width: width, height: height)
          : constraints,
      super(key: key);