Flutter SDK overview
Two packages, one client, a handful of widgets. What each part does and how they fit into an app.
| Package | Contents | Depends on |
|---|---|---|
kletso_ui_schema | JSON schemas, fixtures and Dart models for kletso.ui/v1, kletso.events/v1 and the realtime frames | meta |
kletso_core | KletsoClient: sessions, conversations, transports with reconnect and replay, context, events, notifications, push handoff, KletsoComponentSpec, the fake backend | http, web_socket, clock |
kletso_flutter | Widgets: KletsoChat, KletsoLauncher, KletsoSurfaceView, KletsoNotificationHost, 30 built-in blocks, KletsoTheme, the component and action registries, kletso_flutter:sync | flutter, kletso_core |
Apps depend on kletso_flutter (which brings the others). All three are pure Dart with no platform channels, so they run wherever Flutter runs, including Wasm.
The pieces you touch
Kletso.init(KletsoConfig(...)) → KletsoClient (Kletso.instance)
├─ identifyAnonymous() / authenticate(token:)
├─ setContext / updateContext / track / screen
├─ registerComponent(type, builder, spec:) your widgets for surface blocks
├─ registerAction(name, handler) your handlers for local actions
├─ onOpenUrl, onSystemNotification, setHostData
├─ messages / conversations / connection / session / events / notifications
└─ open(context) / close()
Widgets: KletsoLauncher · KletsoChat · KletsoSurfaceView · KletsoNotificationHost · KletsoConversationList
Theme: KletsoTheme.light/dark/fromServer as a ThemeExtension
Reading order
- Installation and initialisation: config fields, identity, context.
- Chat UI and theming: launcher, sheet or full screen, embedding, brand theme, dark mode.
- Custom components: specs, builders, sync.
- Actions and app commands: local handlers, URL policy, server-initiated commands.
- Host data bindings.
- Notifications and push.
- Connection, offline and replay.
- State, streams and errors.
- Testing with the fake backend.
- Platform notes.