# Flutter

A wrapper for the MOVE SDK is available for Google's Flutter framework and published on pub.dev.

<https://pub.dev/packages/movesdk>

## Installation

Add the Dolphin MOVE SDK package to your flutter app using:

```sh
flutter pub add movesdk
```

or, by adding it as a dependency to your *pubspec.yaml* file and run:

```bash
flutter pub get
```

{% hint style="warning" %}
Add the following section within the **root build.gradle**.

```
allprojects {
    repositories {
        google()
        mavenCentral()
        maven {
            url "https://dolphin.jfrog.io/artifactory/move-sdk-libs-release"
        }
    }
}
```

{% endhint %}

{% hint style="warning" %}
Also please check if the following values are set within the **app build.gradle**.

\
`minSdkVersion 26 or higher`\
`compileSdkVersion 34`\
`targetSdkVersion 34`

<pre><code><strong>android {
</strong>    compileSdkVersion 34
    // ...
    // ...
    defaultConfig {
        // ...
        // ...
        minSdkVersion 26
        targetSdkVersion 34
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        // ...
        // ...
    }
    // ...
    // ...
}
</code></pre>

{% endhint %}

See [Flutter - Using packages](https://docs.flutter.dev/packages-and-plugins/using-packages) for further information regarding package use.

Import the package in your code:

```dart
import 'package:movesdk/movesdk.dart';
```

See the included example ([move-sdk-flutter/example](https://pub.dev/packages/movesdk/example)) project in the package for reference on how to get started.

## iOS

### Initialization

The SDK will be automatically initialized and load its persisted state in the plugin's lifecycle through the`FlutterAppDelegate`.&#x20;

### Setting up Permissions

The MOVE SDK requires several permissions to function.

Make sure required [permissions](/move-platform/sdk/appendix/ios/permission-handling.md) are added in your iOS Runner.workspace and also the corresponding strings for requesting user permissions are set in the projects *Info.plist*.

![Location updates background mode capability](/files/-MaWrFoEnyiReo8XoJL3)

If you are using the [**flutter-permission-handler**](https://github.com/Baseflow/flutter-permission-handler) package refer to [this guide](https://github.com/Baseflow/flutter-permission-handler/blob/main/permission_handler/README.md) (see also [here](https://github.com/Baseflow/flutter-permission-handler/blob/main/permission_handler/example/ios/Podfile)) to add the permissions in your iOS *Podspec* file.

## Android

### Initialization

The SDK needs to be initialized at the start of the app by calling *MoveSdk.init.* It is recommended to put this in the Application's `onCreate` method. This will load the persistent Move SDK state.

```kotlin
import io.dolphin.move.MoveSdk

class MainApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        val sdk = MoveSdk.init(this)
        ...
    }
    
    ...
}
```

### Setting up Permissions

Permission setup is inherited automatically.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.movesdk.com/move-platform/sdk/getting-started/flutter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
