> For the complete documentation index, see [llms.txt](https://dnotifier.gitbook.io/product-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dnotifier.gitbook.io/product-docs/getting-started/installation/dart-flutter.md).

# Dart / Flutter

The DNotifier Dart SDK is a **pure Dart** package. It runs in Flutter (Android, iOS, Web) and in standalone Dart CLI or server projects without platform-specific code in the SDK itself.

## Requirements

* **Dart SDK** 3.0 or later
* **Flutter** 3.x (optional — only if you build a Flutter app)
* DNotifier **appId** and **secret** from the [dashboard](https://app.dnotifier.com) — see [**Create an app**](/product-docs/getting-started/create-app.md)

## Add the dependency

Open `pubspec.yaml` and add:

```yaml
dependencies:
  dnotifier: ^1.1.10
```

Use the latest version shown on [pub.dev/packages/dnotifier](https://pub.dev/packages/dnotifier) if you want to pin to the newest release.

## Resolve packages

### Pure Dart project

```bash
dart pub get
```

### Flutter project

```bash
flutter pub get
```

Both commands download `dnotifier` and its dependencies (`http`, `web_socket_channel`, `uuid`).

## Import the SDK

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

The main export exposes `DNotifier`, message types, workflow helpers, and utilities.

## Flutter platforms

The same `pubspec.yaml` entry works for all Flutter targets:

| Platform                        | WebSocket support | Notes                         |
| ------------------------------- | ----------------- | ----------------------------- |
| Android                         | ✅                 | Uses `web_socket_channel`     |
| iOS                             | ✅                 | Uses `web_socket_channel`     |
| Web                             | ✅                 | Browser WebSocket via package |
| Desktop (Windows, macOS, Linux) | ✅                 | Supported where Dart runs     |

No extra native configuration is required in the SDK — add the dependency and import the library.

## Environment configuration

Load credentials from compile-time defines or a env loader:

```dart
const appId = String.fromEnvironment('DNOTIFIER_APP_ID');
const secret = String.fromEnvironment('DNOTIFIER_SECRET');
```

Run with defines:

```bash
flutter run --dart-define=DNOTIFIER_APP_ID=your-app-id --dart-define=DNOTIFIER_SECRET=your-secret
```

See [**Credentials & environment**](/product-docs/getting-started/credentials.md) for full patterns.

## Verify installation

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

void main() {
  print(DNotifier); // prints the DNotifier class
}
```

Run:

```bash
dart run bin/check.dart
# or
flutter run
```

If the import resolves without errors, installation succeeded.

## Next steps

* [**Your first connection — Dart / Flutter**](/product-docs/getting-started/first-connection/dart-flutter.md)
* [**Your first message — Dart / Flutter**](/product-docs/getting-started/first-message/dart-flutter.md)
* [**Choose your transport**](/product-docs/getting-started/choose-transport.md)
