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

# Flutter Integration

> Start the integration in less than 5 minutes.

Using truemetrics Flutter plugin could be easier.
See here more on how it [works](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)

To use this plugin, just add `truemetrics_flutter_sdk` as a dependency in your `pubspec.yaml` file:

```yaml theme={null}
dependencies:
  truemetrics_flutter_sdk: ^0.0.12
```

> [!NOTE]
>
> **Google Play foreground-service declaration:** the underlying native SDK's recording service declares the
> **`location`** and **`dataSync`** foreground-service types (previously `location` + `specialUse`). In the
> Play Console foreground-service-types form, declare **"Location"** and **"Data sync"** for the Truemetrics
> recording service. If your existing declaration listed **"Special use"**, replace it with **"Data sync"**
> (keep **"Location"**).

Go for the initialize of the SDK

```
final sdk = TruemetricsFlutterSdk();
final config = TruemetricsConfig(config: {
    'apiKey': 'your-api-key',
    'debug': true
    });
await sdk.initialize(config);
```

perform start recording

```
await sdk.startRecording();
```

or Log metadata

```
await sdk.logMetadata({'key': 'value'});
```

and finally stop recording

```
await sdk.stopRecording();
```

and you are done, was easy right :)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.