CrossmintIdentityVerification class

Renders Crossmint's hosted identity verification step in a WebView.

Read-only: the hosted page reports lifecycle events and nothing is sent back to it.

Open it when the order first carries credentials and, while it is open, keep passing the latest non-null credentials so a rotated secret reaches it. Close it on onComplete or onCancel and keep it closed for that order. With session credentials the order leaves requires-kyc as soon as the buyer submits, before the result screen shows, so the controller's identityVerificationCredentials turns null while the flow is still on screen.

CrossmintIdentityVerificationCredentials? _credentials;
String? _closedOrderId;

// Listener on checkoutController:
void _onOrderChanged() {
  final latest = checkoutController.identityVerificationCredentials;
  final orderId = checkoutController.order?['orderId'];
  if (latest != null && orderId != _closedOrderId) {
    setState(() => _credentials = latest);
  }
}

void _closeVerification() => setState(() {
  _credentials = null;
  _closedOrderId = checkoutController.order?['orderId'] as String?;
});

// In build:
if (_credentials != null)
  CrossmintIdentityVerification(
    apiKey: 'YOUR_API_KEY',
    credentials: _credentials!,
    onComplete: (_) => _closeVerification(),
    onCancel: _closeVerification,
  ),
Inheritance

Constructors

CrossmintIdentityVerification({Key? key, required String apiKey, required CrossmintIdentityVerificationCredentials credentials, String? locale, void onReady()?, void onComplete(CrossmintIdentityVerificationStatus status)?, void onCancel()?, void onError(CrossmintIdentityVerificationError error)?, CrossmintIdentityVerificationLoadingBuilder? loadingBuilder, double defaultHeight = 300})
const

Properties

apiKey → String
Crossmint API key. Resolves staging versus production and is forwarded to the hosted page, matching the React Native SDK and the other Crossmint widgets in this package.
final
credentials → CrossmintIdentityVerificationCredentials
Credentials for the verification session.
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 → CrossmintIdentityVerificationLoadingBuilder?
Optional builder for the loading overlay. Falls back to a themed Material spinner, matching CrossmintPaymentMethodManagement.
final
locale → String?
Optional locale tag. Must be one the hosted page recognises, for example en-US, es-ES, pt-PT. An unrecognised tag is not ignored: the page rejects it and reports a non-retriable invalidConfiguration error, which leaves the buyer with a dead screen.
final
onCancel → void Function()?
Called when the buyer abandons verification.
final
onComplete → void Function(CrossmintIdentityVerificationStatus status)?
Called with the outcome when verification finishes.
final
onError → void Function(CrossmintIdentityVerificationError error)?
Called when verification cannot run or continue.
final
onReady → void Function()?
Called when the verification UI is ready.
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<CrossmintIdentityVerification>
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