Skip to main content
The Flutter SDK provides optional UI widgets that can be imported from crossmint_flutter_ui.dart. These pull in Material Design dependencies — if you prefer a fully headless approach, use the controllers directly.

CrossmintWalletStatusBuilder

Reactive widget that rebuilds whenever the wallet status or instance changes.

Props

builder
CrossmintWalletStatusWidgetBuilder
required

Usage

import 'package:crossmint_flutter/crossmint_flutter_ui.dart';

CrossmintWalletStatusBuilder(
  builder: (context, data) {
    switch (data.state.walletStatus) {
      case CrossmintWalletStatus.inProgress:
        return const CircularProgressIndicator();
      case CrossmintWalletStatus.loaded:
        return Text('Address: ${data.state.currentWallet!.address}');
      default:
        return const Text('No wallet');
    }
  },
)

CrossmintWalletConsumer

Provides access to the wallet context data from the widget tree.

Usage

CrossmintWalletConsumer(
  builder: (context, data) {
    return ElevatedButton(
      onPressed: () async {
        final wallet = data.state.currentWallet;
        final balances = await wallet?.balances();
        print('Balances: $balances');
      },
      child: const Text('Check Balances'),
    );
  },
)

CrossmintOtpSignerListener

Automatically listens for OTP challenges and shows the appropriate dialog. This is a Flutter advantage over React Native — OTP prompts are handled declaratively.

Props

otpController
CrossmintWalletOtpController
required
child
Widget
required
enabled
bool
barrierDismissible
bool

Usage

CrossmintOtpSignerListener(
  otpController: walletController.otp,
  child: const WalletScreen(),
)

CrossmintAuthForm

Pre-built authentication form with email OTP and OAuth buttons.

Props

auth
CrossmintAuthClient
required
providers
List<CrossmintOAuthProvider>
showEmailSignIn
bool
authModalTitle
String?
Custom title shown on the OTP verification step (e.g. “Sign in to Acme”).
onAuthenticated
VoidCallback?
onError
void Function(Object error)?

Usage

CrossmintAuthForm(
  auth: client.auth,
  onAuthenticated: () {
    print('Logged in!');
  },
)

CrossmintEmailSignIn

Email OTP sign-in form widget.

Props

auth
CrossmintAuthClient
required
viewModel
CrossmintEmailSignInViewModel?
Optional view model override. When null, the widget constructs a fresh [CrossmintEmailSignInViewModel] bound to [auth] and disposes it with the widget. When provided, the widget observes the view model but does not dispose it — the caller owns the lifecycle.
otpTitle
String?
Custom title for the OTP verification step. Defaults to 'Check your email'.
onAuthenticated
VoidCallback?
onError
void Function(Object error)?

Usage

CrossmintEmailSignIn(
  auth: client.auth,
  onAuthenticated: () {
    print('Logged in!');
  },
)

CrossmintGoogleSignInButton / CrossmintTwitterSignInButton

OAuth sign-in buttons.

Props

auth
CrossmintAuthClient
required
Auth client used to start the OAuth flow.
onSuccess
VoidCallback?
Called after the OAuth flow completes successfully. Use this to navigate away or refresh dependent state.
onError
void Function(Object error)?
Called when the OAuth flow throws. Receives the underlying exception so consumers can surface a localized error message.
enabled
bool
When false, the button is rendered in a disabled visual state and taps do not start the OAuth flow. Defaults to true.

Usage

Column(
  children: [
    CrossmintGoogleSignInButton(auth: client.auth),
    const SizedBox(height: 12),
    CrossmintTwitterSignInButton(auth: client.auth),
  ],
)

CrossmintExportPrivateKeyButton

Renders a button that allows the user to export their wallet’s private key. Only works with email and phone signers. Will not render for passkey or external wallet signers.

Props

wallet
CrossmintRuntimeWalletBase
required
Wallet whose private key will be exported. The button only renders when [CrossmintRuntimeWalletBase.canExportPrivateKey] is true (email/phone signer wallets).
onExported
VoidCallback?
Called after the export flow completes successfully.
onError
void Function(Object error)?
Called when the export flow throws. Receives the underlying exception so consumers can surface a localized error message.
childBuilder
CrossmintExportPrivateKeyButtonBuilder?
Optional builder for the button visual. When null, falls back to the React Native parity Material OutlinedButton with a themed CircularProgressIndicator while the export is in flight. When non-null, the builder is invoked whenever the wallet is eligible to export and receives the current isLoading flag plus an onExport callback that the consumer wires to their own tap target. The onExport callback is null while loading so consumers can disable their button directly without a separate mounted check.

Usage

import 'package:crossmint_flutter/crossmint_flutter_ui.dart';

CrossmintExportPrivateKeyButton(
  wallet: wallet,
  onExported: () => print('Key exported'),
)

CrossmintEmbeddedCheckout

WebView-based checkout widget for handling payments (fiat and crypto).

Props

apiKey
String
required
Crossmint API key.
config
CrossmintCheckoutConfig
required
Checkout configuration (order, payment, appearance).
payer
CrossmintCheckoutPayer?
Optional crypto payer override for signing transactions within checkout.
checkoutController
CrossmintCheckoutController?
Optional reactive controller for checkout order state.
onOrderUpdated
void Function(Map<String, Object?> order)?
Called when the order state changes.
onOrderCreationFailed
void Function(String errorMessage)?
Called when order creation fails.
onDiagnostic
void Function(CrossmintCheckoutDiagnostic diagnostic)?
Called when the hosted checkout emits a runtime diagnostic.
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).
defaultHeight
double
Initial height before the hosted page reports its actual height.

Usage

final checkoutController = CrossmintCheckoutController();

CrossmintEmbeddedCheckout(
  apiKey: 'YOUR_CLIENT_API_KEY',
  config: CrossmintCheckoutConfig(
    order: CrossmintCheckoutNewOrder.typed(
      lineItems: [
        CrossmintCheckoutLineItem.collection(
          collectionLocator: 'crossmint:collection-id',
          callData: {'quantity': 1},
        ),
      ],
    ),
    payment: CrossmintCheckoutPayment(
      fiat: CrossmintCheckoutFiatPayment(enabled: true),
      crypto: CrossmintCheckoutCryptoPayment(enabled: false),
    ),
  ),
  checkoutController: checkoutController,
  onOrderUpdated: (order) => print('Order: ${order['status']}'),
  onOrderCreationFailed: (error) => print('Error: $error'),
)

CrossmintNftCard / CrossmintNftCollectionView / CrossmintNftDetailView

Widgets for displaying NFT content. These are Flutter-only features not available in the React Native SDK.

Usage

// Single NFT card
CrossmintNftCard(
  nft: nftRecord,
  onTap: () => print('Tapped!'),
)

// Collection view
CrossmintNftCollectionView(
  nfts: nftList,
  onNftTap: (nft) => print('Tapped: ${nft.id}'),
)

// Detail view
CrossmintNftDetailView(
  nft: nftRecord,
)

CrossmintPaymentMethodManagement

Widget for managing saved payment methods. This is a Flutter-only feature.

Props

apiKey
String
required
Crossmint API key.
jwt
String
required
JWT token for authenticated access (required by the hosted page).
appearance
CrossmintCheckoutAppearance?
Optional appearance overrides (reuses the checkout appearance config).
onPaymentMethodSelected
dynamic
onAgenticEnrollmentCreated
dynamic
loadingBuilder
CrossmintPaymentMethodManagementLoadingBuilder?
Optional builder for the loading overlay rendered on top of the hosted payment-method-management 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).
defaultHeight
double
Initial height before the hosted page reports its actual height.

Usage

CrossmintPaymentMethodManagement(
  apiKey: 'YOUR_CLIENT_API_KEY',
  jwt: session.jwt,
  onPaymentMethodSelected: (method) {
    print('Selected: $method');
  },
)

CrossmintWalletUiState (data.state)

The state exposed on CrossmintWalletContextData (the second argument of every builder). Fields and convenience getters:
Field / getterTypeDescription
isInitializingbool
isLoadingWalletbool
authStateCrossmintAuthState
walletStatusCrossmintWalletStatus
currentWalletCrossmintWallet?
pendingOtpChallengeCrossmintOtpChallenge?
initializationErrorObject?
walletErrorObject?
isAuthenticatedbool
isLoggedOutbool
userCrossmintAuthenticatedUser?
authErrorMessageString?
errorObject?
errorMessageString?
hasWalletbool
needsOtpbool