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

# CrossmintPaymentMethodManagement

> Flutter Class

**Class**

Payment method management widget matching the official Crossmint RN SDK `CrossmintPaymentMethodManagement`.

```dart theme={null}
class CrossmintPaymentMethodManagement extends StatefulWidget
```

Loads the Crossmint hosted card management page in a WebView. Listens for
payment method selection and agentic enrollment events. Read-only — no
outgoing messages are sent to the WebView.

Requires a JWT for authenticated access.

```dart theme={null}
CrossmintPaymentMethodManagement(
  apiKey: 'YOUR_API_KEY',
  jwt: currentSession.jwt,
  onPaymentMethodSelected: (pm) => print('Selected: ${pm['paymentMethodId']}'),
)
```

## Constructors

### CrossmintPaymentMethodManagement

```dart theme={null}
const CrossmintPaymentMethodManagement({
  super.key,
  required this.apiKey,
  required this.jwt,
  this.appearance,
  this.onPaymentMethodSelected,
  this.onAgenticEnrollmentCreated,
  this.loadingBuilder,
  this.defaultHeight = 300,
})
```

## Properties

### apiKey

```dart theme={null}
final String apiKey
```

Crossmint API key.

### jwt

```dart theme={null}
final String jwt
```

JWT token for authenticated access (required by the hosted page).

### appearance

```dart theme={null}
final CrossmintCheckoutAppearance? appearance
```

Optional appearance overrides (reuses the checkout appearance config).

### loadingBuilder

```dart theme={null}
final CrossmintPaymentMethodManagementLoadingBuilder? loadingBuilder
```

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

```dart theme={null}
final double defaultHeight
```

Initial height before the hosted page reports its actual height.

## Methods

### createState

```dart theme={null}
State<CrossmintPaymentMethodManagement> createState()
```
