omni_adapter 0.1.0-beta.2
omni_adapter: ^0.1.0-beta.2 copied to clipboard
Join a Connect Omni stage from Dart or Flutter and exchange real-time messages with prototypes.
example/README.md
Dart examples #
Pure-Dart examples — they run on the Dart VM (dart run), no Flutter needed.
For a Flutter app see ../example_flutter/.
cd dart/example
dart pub get
dart run 01_quickstart.dart "cst_…" # Stage → Share → Adapter keys → Create key
| Example | What it shows |
|---|---|
01_quickstart.dart |
Join, one acked round-trip, receive a channel. Start here. |
02_sensor_bridge.dart |
High-frequency values with throttle, offline queue, and auto-rejoin when the host closes and reopens the stage. |
03_screen_adapter.dart |
providesView declaration (so a screen layer can pick this adapter), exclusiveName / standby, raw signalling passthrough. |
04_roster_bridge.dart |
Bidirectional: a command on one channel is answered on another, with members() printed on every join/leave. |
01, 02 and 04 are the six-language common scenarios — quickstart,
resilience and bidirectional+roster respectively. The same three exist in every
other language (docs/parity.json → commonExamples, kept honest by the CI
parity job).
The credential can also come from the environment: CONNECT_TOKEN=cst_… dart run 01_quickstart.dart.
Every example prints err.hint on failure — that line is the next action, and it is
usually the whole fix (wrong URL base, stage not open, token re-issued).