> For the complete documentation index, see [llms.txt](https://docs.autonomi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.autonomi.com/developers/sdk/install/reference/language-bindings/dart.md).

# Dart

The Dart SDK is the Dart client for the `antd` daemon.

## Install

```bash
dart pub add antd
```

## Connect to the daemon

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

void main() async {
  final client = AntdClient(baseUrl: 'http://localhost:8082');
  final health = await client.health();
  print(health.network);
  client.close();
}
```

## Store and retrieve data

```dart
import 'dart:convert';
import 'dart:typed_data';

import 'package:antd/antd.dart';

void main() async {
  final client = AntdClient();
  final result = await client.dataPutPublic(Uint8List.fromList(utf8.encode('Hello, Autonomi!')));
  print(result.address);

  final data = await client.dataGetPublic(result.address);
  print(utf8.decode(data));
  client.close();
}
```

## Type mappings

| Autonomi type  | Dart type       |
| -------------- | --------------- |
| `HealthStatus` | Dart model type |
| `PutResult`    | Dart model type |
| Raw data       | `Uint8List`     |

## Error handling

```dart
try {
  final data = await client.dataGetPublic('bad-address');
  print(data);
} on NotFoundError {
  print('Data not found');
} on PaymentError {
  print('Insufficient funds');
} on AntdError catch (error) {
  print(error);
}
```

## Full API reference

For all available daemon endpoints, see the [REST API](/developers/sdk/install/reference/rest-api.md).
