SDKs
Dart & Flutter SDK
The official Wayline SDK for Dart & Flutter: Dart 3 servers and CLIs. For Flutter apps, call your own backend — never ship a Wayline key in an app.
Install
dart pub add waylineQuickstart
Set WAYLINE_API_KEY to a test key (see the Quickstart), then:
import 'dart:io';
import 'package:wayline/wayline.dart';
Future<void> main() async {
final wayline = Wayline(apiKey: Platform.environment['WAYLINE_API_KEY']!);
final d = await wayline.distance(
origin: LatLng(23.7925, 90.4078),
destination: LatLng(23.733, 90.4172),
units: Units.imperial,
);
print('${d.distanceMiles} mi, ${d.durationSeconds} s');
wayline.close();
}Errors
Non-2xx responses raise a typed error after retries are exhausted. Branch on code — the full list is in the error reference.
try {
await wayline.distance(origin: LatLng(0, 0), destination: LatLng(0, 1));
} on WaylineException catch (e) {
print('${e.code} ${e.status} ${e.requestId}');
}Configuration
| Option | Default | Description |
|---|---|---|
| API key | WAYLINE_API_KEY | Your live or test key. Never logged. |
| Base URL | https://api.wayline.cloud | Override for staging or a proxy. |
| Timeout | 30 seconds | Per attempt. |
| Max retries | 3 | For 429 and 5xx, with exponential backoff + jitter, honoring Retry-After. |
Source and releases
Package: wayline on pub.dev. Source: packages/sdk-dart. Versions follow semantic versioning; see the CHANGELOG in the package and our product changelog.