PeachWalletButton class
A branded Apple Pay / Google Pay button embedded directly in your checkout, with no Hyperswitch payment sheet.
Availability is decided by the SDK: the button only renders when the merchant has that wallet configured, the connector returned a session token, and the wallet is usable on the device. Keep a card fallback in your checkout — treat onReady as the signal that the button is actually usable.
On Android the host Activity must be a FlutterFragmentActivity (not
FlutterActivity), because the button attaches a fragment.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- PeachWalletButton
Constructors
-
PeachWalletButton({Key? key, required String clientSecret, WalletButtonType type = WalletButtonType.expressCheckout, GooglePayButtonConfig? googlePay, ValueChanged<
PaymentResult> ? onResult, ValueChanged<bool> ? onReady, WalletButtonController? controller, double? height}) -
const
Properties
- clientSecret → String
-
Client secret of the payment intent to pay.
final
- controller → WalletButtonController?
-
Optional controller for starting the payment programmatically.
final
- googlePay → GooglePayButtonConfig?
-
Google Pay options. Required for WalletButtonType.googlePay on Android.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
Fixed height, if you need one. Left null the button sizes itself, which is
what you usually want — an express row is taller than a single button.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onReady
→ ValueChanged<
bool> ? -
Called when the button becomes usable. Until this fires, the wallet may not
yet be known to be available.
final
-
onResult
→ ValueChanged<
PaymentResult> ? -
Called once the payment finishes, is cancelled, or fails.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → WalletButtonType
-
Which wallet button to render.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< PeachWalletButton> -
Creates the mutable state for this widget at a given location in the tree.
override
-
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, int wrapWidth = 65}) → 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