# Bluetooth provider

Canonical page: https://docs.ovok.com/flutter-sdk/reference/ovok_flutter/bluetooth-provider

{/* Generated by scripts/generate_reference.dart; do not edit. */}

## BluetoothProvider [#bluetoothprovider]

```dart
class BluetoothProvider extends StatefulWidget
```

Provides a Bluetooth runtime and its live snapshot to descendant widgets.

The application owns [`runtime`](#bluetoothproviderruntime) and must dispose it when it is no longer
needed.

### Constructors [#constructors]

#### BluetoothProvider.new [#bluetoothprovidernew]

```dart
BluetoothProvider({
  required BluetoothRuntime runtime,
  required Widget child,
  Key? key,
})
```

Creates a scope for [`runtime`](#bluetoothproviderruntime) and [`child`](#bluetoothproviderchild).

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `runtime` | `BluetoothRuntime` | required named |  |
| `child` | `Widget` | required named |  |
| `key` | `Key?` | named |  |

### Properties [#properties]

#### BluetoothProvider.runtime [#bluetoothproviderruntime]

```dart
final BluetoothRuntime runtime
```

The runtime the descendant widgets use.

#### BluetoothProvider.child [#bluetoothproviderchild]

```dart
final Widget child
```

The widgets that need Bluetooth access.

### Methods [#methods]

#### BluetoothProvider.of [#bluetoothproviderof]

```dart
BluetoothRuntime of(BuildContext context)
```

Reads the nearest runtime, subscribing to its provider scope.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `context` | `BuildContext` | positional |  |

Returns `BluetoothRuntime`.

#### BluetoothProvider.snapshotOf [#bluetoothprovidersnapshotof]

```dart
BluetoothSnapshot snapshotOf(BuildContext context)
```

Reads the current runtime snapshot and rebuilds when it changes.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `context` | `BuildContext` | positional |  |

Returns `BluetoothSnapshot`.
