> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pay with Card - Memecoins (Flutter)

> Create a fully customized embedded memecoin checkout experience for Flutter that accepts credit cards

<Snippet file="enterprise-feature.mdx" />

<Note>
  For this quickstart, you will create a minimal Flutter app. Make sure you have <a href="https://docs.flutter.dev/get-started/install" target="_blank">Flutter installed</a>.
</Note>

## Create a New Flutter Project + Crossmint SDK

<Steps>
  <Step title="Create a new Flutter app">
    ```bash theme={null}
    flutter create crossmint_checkout_quickstart

    cd crossmint_checkout_quickstart
    ```
  </Step>

  <Step title="Install crossmint_flutter">
    <Snippet file="client-sdk-flutter-installation-cmd.mdx" />
  </Step>

  <Step title="Set your environment variables">
    Pass your API key and configuration via Dart defines:

    ```bash theme={null}
    flutter run \
      --dart-define=CROSSMINT_API_KEY=YOUR_CLIENT_SIDE_API_KEY \
      --dart-define=RECIPIENT_WALLET=YOUR_SOLANA_WALLET_ADDRESS \
      --dart-define=RECEIPT_EMAIL=YOUR_EMAIL@example.com
    ```

    <Note>The `receiptEmail` field is **required** for delivering payment receipts to customers.</Note>
  </Step>

  <Step title="Replace lib/main.dart with">
    ```dart theme={null}
    import 'package:flutter/material.dart';
    import 'package:crossmint_flutter/crossmint_flutter_ui.dart';

    const apiKey = String.fromEnvironment('CROSSMINT_API_KEY');
    const recipientWallet = String.fromEnvironment('RECIPIENT_WALLET');
    const receiptEmail = String.fromEnvironment('RECEIPT_EMAIL');

    void main() {
      runApp(const MaterialApp(home: CheckoutScreen()));
    }

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

      @override
      Widget build(BuildContext context) {
        final checkoutController = CrossmintCheckoutController();

        return Scaffold(
          body: SafeArea(
            child: CrossmintEmbeddedCheckout(
              apiKey: apiKey,
              config: CrossmintCheckoutConfig(
                order: CrossmintCheckoutNewOrder.typed(
                  lineItems: [
                    CrossmintCheckoutLineItem.tokenWithExecutionParameters(
                      tokenLocator:
                          'solana:7EivYFyNfgGj8xbUymR7J4LuxUHLKRzpLaERHLvi7Dgu', // XMEME token (staging)
                      executionParameters: {
                        'mode': 'exact-in',
                        'amount': '1',
                        'maxSlippageBps': '500',
                      },
                    ),
                  ],
                  recipient: CrossmintCheckoutWalletRecipient(
                    walletAddress: recipientWallet,
                  ),
                ),
                payment: CrossmintCheckoutPayment(
                  fiat: CrossmintCheckoutFiatPayment(enabled: true),
                  crypto: CrossmintCheckoutCryptoPayment(enabled: false),
                  receiptEmail: receiptEmail,
                ),
              ),
              checkoutController: checkoutController,
              onOrderUpdated: (order) =>
                  debugPrint('Order updated: ${order['status']}'),
              onOrderCreationFailed: (error) =>
                  debugPrint('Error: $error'),
            ),
          ),
        );
      }
    }
    ```
  </Step>

  <Step title="Run your project">
    Run with the same `--dart-define` flags from step 3:

    <CodeGroup>
      ```bash iOS theme={null}
      flutter run -d ios \
        --dart-define=CROSSMINT_API_KEY=YOUR_CLIENT_SIDE_API_KEY \
        --dart-define=RECIPIENT_WALLET=YOUR_SOLANA_WALLET_ADDRESS \
        --dart-define=RECEIPT_EMAIL=YOUR_EMAIL@example.com
      ```

      ```bash Android theme={null}
      flutter run -d android \
        --dart-define=CROSSMINT_API_KEY=YOUR_CLIENT_SIDE_API_KEY \
        --dart-define=RECIPIENT_WALLET=YOUR_SOLANA_WALLET_ADDRESS \
        --dart-define=RECEIPT_EMAIL=YOUR_EMAIL@example.com
      ```

      ```bash Chrome theme={null}
      flutter run -d chrome \
        --dart-define=CROSSMINT_API_KEY=YOUR_CLIENT_SIDE_API_KEY \
        --dart-define=RECIPIENT_WALLET=YOUR_SOLANA_WALLET_ADDRESS \
        --dart-define=RECEIPT_EMAIL=YOUR_EMAIL@example.com
      ```
    </CodeGroup>
  </Step>
</Steps>
