# Integrating a pub.dev package

> Add the Grovs SDK to your Flutter project from pub.dev.

Source: https://docs.grovs.io/docs/how-to-guides/flutter/pub-dev

### 1. Add the package

```bash
flutter pub add grovs_flutter_plugin:^3.1.1
```

This updates `pubspec.yaml` and fetches the package. To do it by hand, add the package under `dependencies` and run `flutter pub get`. The plugin needs Flutter 3.38.0 or later.

### 2. Check pubspec.yaml

`grovs_flutter_plugin` should be listed under `dependencies`:

```yaml
dependencies:
  flutter:
    sdk: flutter
  grovs_flutter_plugin: ^3.1.1
```

### 3. Import the package

```dart
import 'package:grovs_flutter_plugin/grovs.dart';
import 'package:grovs_flutter_plugin/models/grovs_link.dart';
```

The first import provides the `Grovs` class and the in-app message types. The second provides link and error types such as `GenerateLinkParams`, `DeeplinkDetails` and `GrovsException`.

### 4. Run the app

**iOS**

```bash
flutter run -d ios
```

**Android**

```bash
flutter run -d android
```

**Any device**

```bash
flutter run
```

Runs on the connected device or emulator.

Grovs includes native code, so iOS and Android need platform setup too. See the [Flutter Quick Start](https://docs.grovs.io/docs/sdk/flutter/quick-start).
