CrossmintEmbeddedCheckout class

Embedded checkout widget matching the official Crossmint RN SDK CrossmintEmbeddedCheckoutV3.

Loads the Crossmint hosted checkout page in a WebView and communicates bidirectionally via postMessage for dynamic sizing, order updates, and crypto transaction signing.

CrossmintEmbeddedCheckout(
  apiKey: 'YOUR_API_KEY',
  config: CrossmintCheckoutConfig(
    order: CrossmintCheckoutNewOrder(
      lineItems: [{'collectionLocator': 'YOUR_COLLECTION_LOCATOR'}],
    ),
    payment: CrossmintCheckoutPayment(
      fiat: CrossmintCheckoutFiatPayment(enabled: true),
      crypto: CrossmintCheckoutCryptoPayment(enabled: false),
    ),
  ),
  onOrderUpdated: (order) => print('Order: $order'),
)

Host lifecycle notes:

  • changing apiKey or config reloads the hosted checkout
  • if the host app reuses a checkoutController across different checkout scenarios, clear it or replace it before rebuilding to avoid stale order state
  • use onDiagnostic to observe blocked navigation, malformed hosted messages, and WebView resource errors in staging or production
Inheritance

Constructors

CrossmintEmbeddedCheckout({Key? key, required String apiKey, required CrossmintCheckoutConfig config, CrossmintCheckoutPayer? payer, CrossmintCheckoutController? checkoutController, void onOrderUpdated(Map<String, Object?> order)?, void onOrderCreationFailed(String errorMessage)?, void onDiagnostic(CrossmintCheckoutDiagnostic diagnostic)?, CrossmintCheckoutLoadingBuilder? loadingBuilder, double defaultHeight = 400})
const

Properties

apiKey String
Crossmint API key.
final
checkoutController CrossmintCheckoutController?
Optional reactive controller for checkout order state.
final
config CrossmintCheckoutConfig
Checkout configuration (order, payment, appearance).
final
defaultHeight double
Initial height before the hosted page reports its actual height.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loadingBuilder CrossmintCheckoutLoadingBuilder?
Optional builder for the loading overlay rendered on top of the hosted checkout WebView while the page is loading. When null, the widget falls back to a Material CircularProgressIndicator inside a themed background container (the React Native Crossmint SDK parity default).
final
onDiagnostic → void Function(CrossmintCheckoutDiagnostic diagnostic)?
Called when the hosted checkout emits a runtime diagnostic.
final
onOrderCreationFailed → void Function(String errorMessage)?
Called when order creation fails.
final
onOrderUpdated → void Function(Map<String, Object?> order)?
Called when the order state changes.
final
payer CrossmintCheckoutPayer?
Optional crypto payer override for signing transactions within checkout.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<CrossmintEmbeddedCheckout>
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