CrossmintEmbeddedOfframp class

Runs one offramp session in a WebView: bank details, quote, identity verification, one signed deposit, and payout tracking.

The widget reloads the offramp when apiKey, credentials, appearance, locale, fill or whether the payer has signMessage changes. The callbacks can change without a reload.

Identity verification uses the camera. Add NSCameraUsageDescription to the iOS Info.plist. On Android, declare android.permission.CAMERA and hold the runtime permission before the user reaches verification, for example by requesting it before mounting the widget or when onStatusChange reports CrossmintOfframpStatus.verifyingIdentity; the SDK does not request it.

On Android, the app crashes if the WebView renderer process dies, because webview_flutter_android has no render-process-gone hook.

CrossmintEmbeddedOfframp(
  apiKey: 'YOUR_CLIENT_API_KEY',
  credentials: CrossmintEmbeddedOfframpCredentials(
    sessionId: session.sessionId,
    clientSecret: session.clientSecret,
  ),
  payer: CrossmintEmbeddedOfframpPayer.wallet(wallet),
  onComplete: (orderId, txId) => showDepositReceived(orderId),
  onCancel: closeOfframp,
  onError: (error) {
    if (!error.retriable) closeOfframp();
  },
)
Inheritance

Constructors

CrossmintEmbeddedOfframp({Key? key, required String apiKey, required CrossmintEmbeddedOfframpCredentials credentials, required CrossmintEmbeddedOfframpPayer payer, CrossmintCheckoutAppearance? appearance, CrossmintOfframpLocale? locale, bool fill = false, VoidCallback? onReady, void onStatusChange(CrossmintOfframpStatus status, String? orderId)?, void onComplete(String orderId, String txId)?, VoidCallback? onCancel, void onError(CrossmintOfframpError error)?, Widget loadingBuilder(BuildContext context)?, double defaultHeight = 500})
const

Properties

apiKey → String
Client API key (ck_). Resolves staging versus production. With any other key the widget loads nothing and reports a non-retriable CrossmintOfframpErrorReason.invalidConfiguration.
final
appearance → CrossmintCheckoutAppearance?
final
credentials → CrossmintEmbeddedOfframpCredentials
final
defaultHeight → double
Height before the page reports its own. Ignored when fill is set.
final
fill → bool
Fills the parent's bounded height instead of sizing to the content.
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 → Widget Function(BuildContext context)?
final
locale → CrossmintOfframpLocale?
Defaults to the device language.
final
onCancel → VoidCallback?
The user closed the flow. Without it the Close and Cancel buttons do nothing.
final
onComplete → void Function(String orderId, String txId)?
The deposit is confirmed; the bank payout can take longer. Can fire again for a reopened withdrawal, so dedupe by orderId.
final
onError → void Function(CrossmintOfframpError error)?
final
onReady → VoidCallback?
The first screen is shown. Fires once per load.
final
onStatusChange → void Function(CrossmintOfframpStatus status, String? orderId)?
The flow moved to another step. orderId can change during one withdrawal, so keep the latest.
final
payer → CrossmintEmbeddedOfframpPayer
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<CrossmintEmbeddedOfframp>
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