> ## 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.

# CrossmintCheckoutController

> Flutter Class

**Class**

Reactive controller for checkout order state, matching the official Crossmint RN SDK's `useCrossmintCheckout()` hook.

```dart theme={null}
class CrossmintCheckoutController extends ChangeNotifier
```

Pass this to `CrossmintEmbeddedCheckout` to receive order updates
as observable state instead of (or in addition to) the `onOrderUpdated`
callback.

```dart theme={null}
// Pseudocode: replace `yourCheckoutConfig` with a real
// `CrossmintCheckoutConfig` instance.
final checkoutController = CrossmintCheckoutController();

// In widget tree:
CrossmintEmbeddedCheckout(
  apiKey: 'YOUR_API_KEY',
  config: yourCheckoutConfig,
  checkoutController: checkoutController,
)

// Listen reactively:
ListenableBuilder(
  listenable: checkoutController,
  builder: (context, _) {
    final order = checkoutController.order;
    return Text('Status: ${order?['status']}');
  },
)
```

## Properties

### order

```dart theme={null}
Map<String, Object?>? get order
```

The current order object from the checkout, or `null` if no order yet.

### orderClientSecret

```dart theme={null}
String? get orderClientSecret
```

The server-assigned client secret for the current order.

## Methods

### updateOrder

```dart theme={null}
void updateOrder(Map<String, Object?> data)
```

Updates the order state from a checkout `order:updated` event.

### clear

```dart theme={null}
void clear()
```

Clears the order state.
