Install
This content is for the 0.1 version. Switch to the latest version for up-to-date documentation.
Two packages. Which you want depends on whether a widget tree is involved.
dart pub add ahp_sdkimport 'package:ahp_sdk/ahp_sdk.dart';One import gets everything: the generated protocol types, the reducers, the reconciliation engine, the transport, and the runtime. There are no secondary entry points to remember.
Flutter
Section titled “Flutter”flutter pub add ahp_flutterimport 'package:ahp_flutter/ahp_flutter.dart';The bindings re-export the whole SDK, so this is the only import a Flutter app
needs — adding ahp_sdk alongside it is redundant.
Two names are withheld from that re-export, because Flutter already defines them and the collision would be silent:
| Withheld | Why |
|---|---|
Icon |
Material’s Icon widget |
TextSelection |
dart:ui’s TextSelection |
Reach them through a prefixed import when you need the protocol’s versions:
import 'package:ahp_sdk/ahp_sdk.dart' as ahp;
final icon = ahp.Icon(/* ... */);Requirements
Section titled “Requirements”| Dart SDK | ^3.9.0 |
| Runtime dependency | web_socket_channel |
The Dart 3.9 floor is not arbitrary. The generated codecs use null-aware
elements ('key': ?value) throughout, which is what lets an absent optional
field be omitted from a JSON map rather than written as an explicit null — and
that distinction is exactly what the round-trip fixtures assert.
Verifying the install
Section titled “Verifying the install”The package ships an executable that connects to a live host and prints what it mirrors back:
dart run ahp_sdk:ahp --url ws://localhost:51234See The CLI for what it does and how to read its output.
Sandboxed platforms
Section titled “Sandboxed platforms”On macOS, a sandboxed app needs the network-client entitlement or the WebSocket will fail to open with no useful diagnostic:
<key>com.apple.security.network.client</key><true/>Add it to both DebugProfile.entitlements and Release.entitlements.