Skip to main content
The Crossmint Flutter SDK (crossmint_flutter) provides an embedded checkout widget for integrating Crossmint checkout into your Flutter application. It supports fiat (credit card, Apple Pay, Google Pay) and crypto payment methods.

Quick Start

Install the SDK and add the embedded checkout widget to your Flutter app.

Usage

checkout_screen.dart
import 'package:crossmint_flutter/crossmint_flutter_ui.dart';

class CheckoutScreen extends StatefulWidget {
  const CheckoutScreen({super.key});

  @override
  State<CheckoutScreen> createState() => _CheckoutScreenState();
}

class _CheckoutScreenState extends State<CheckoutScreen> {
  final _controller = CrossmintCheckoutController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: CrossmintEmbeddedCheckout(
        apiKey: 'YOUR_CLIENT_API_KEY',
        config: CrossmintCheckoutConfig(
          order: CrossmintCheckoutNewOrder.typed(
            lineItems: [
              CrossmintCheckoutLineItem.collection(
                collectionLocator: 'crossmint:YOUR_COLLECTION_ID',
              ),
            ],
          ),
          payment: CrossmintCheckoutPayment(
            fiat: CrossmintCheckoutFiatPayment(enabled: true),
            crypto: CrossmintCheckoutCryptoPayment(enabled: true),
          ),
        ),
        checkoutController: _controller,
        onOrderUpdated: (order) {
          debugPrint('Order updated: ${order['status']}');
        },
      ),
    );
  }
}