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

# CrossmintWalletProvider

> Flutter Final Class

**Final Class**

Recommended app-facing integration widget — owns client, auth, and wallet-controller lifecycle plus the hidden signer bridge host.

```dart theme={null}
final class CrossmintWalletProvider extends StatefulWidget
```

Wrap your app tree in this widget, pass a `CrossmintWalletProviderConfig`
with API key and an optional `CrossmintWalletControllerConfig.createOnLogin`,
and use `CrossmintWalletGate` to render UI based on wallet lifecycle.

Behind the scenes this widget:

1. Constructs a `CrossmintClient` and `CrossmintWalletController` from
   `config`.
2. Mounts `CrossmintClientScope`, `CrossmintAuthScope`, and
   `CrossmintWalletScope` so descendants can resolve them via
   `CrossmintWalletContext.of`.
3. Mounts `CrossmintWalletHost` — which in turn hosts the hidden signer
   WebView — unless `CrossmintWalletProviderConfig.mountBridgeHosts` is
   explicitly set to `false`.
4. Calls `restoreSession()` so any persisted JWT is applied before the
   first frame.

If you need more control over construction or want to share a client
across surfaces, use `CrossmintWalletHost` with your own pre-built
`CrossmintClient` + `CrossmintWalletController` instead.

## Constructors

### CrossmintWalletProvider

```dart theme={null}
const CrossmintWalletProvider({
  super.key,
  required this.config,
  required this.child,
})
```

Creates a provider widget.

## Properties

### config

```dart theme={null}
final CrossmintWalletProviderConfig config
```

The configuration this provider was built with.

### child

```dart theme={null}
final Widget child
```

The subtree rendered once dependencies are ready. Pair with `CrossmintWalletGate` to show a loading state until then.

## Methods

### createState

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