ApplePayButton class

A widget to show the Apple Pay button according to the rules and constraints specified in PayButton.

Example usage:

ApplePayButton(
  paymentConfiguration: _paymentConfiguration,
  paymentItems: _paymentItems,
  style: ApplePayButtonStyle.black,
  type: ApplePayButtonType.buy,
  margin: const EdgeInsets.only(top: 15.0),
  onPaymentResult: onApplePayResult,
  loadingIndicator: const Center(
    child: CircularProgressIndicator(),
  ),
)
Inheritance

Constructors

ApplePayButton({Key? key, PayProvider buttonProvider = PayProvider.apple_pay, required PaymentConfiguration paymentConfiguration, void onPaymentResult(Map<String, dynamic> result)?, required List<PaymentItem> paymentItems, double? cornerRadius, ApplePayButtonStyle style = ApplePayButtonStyle.black, ApplePayButtonType type = ApplePayButtonType.plain, double width = RawApplePayButton.minimumButtonWidth, double height = RawApplePayButton.minimumButtonHeight, EdgeInsets margin = EdgeInsets.zero, VoidCallback? onPressed, void onError(Object? error)?, Widget? childOnError, Widget? loadingIndicator})

Properties

buttonProvider PayProvider
Specifies the payment provider supported by the button
finalinherited
childOnError Widget?
A replacement widget shown instead of the button when the payment process errors. This can be used to show a different checkout button or an error message.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
height double
finalinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loadingIndicator Widget?
An optional widget to show while the payment provider checks whether a user can pay with it and the button loads.
finalinherited
margin EdgeInsets
finalinherited
onError → (void Function(Object? error)?)
A function called when there's an error in the payment process.
finalinherited
onPaymentResult → (void Function(Map<String, dynamic> result)?)
A function called when the payment process yields a result.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
width double
finalinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<PayButton>
Creates the mutable state for this widget at a given location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited