Types & Models
This page documents the most important public models returned by the Dart/Flutter SDK.
Query models
QueryResponse
Returned by client.query(...).
success: boolresults: List<QueryResult>(one per statement)tookMs: double?error: ErrorDetail?
Convenience helpers:
rows→ first result’s parsedList<List<dynamic>>columns→ first result’sList<SchemaField>toMaps()→ first result’sList<Map<String, dynamic>>
Implementation note: the SDK parses row JSON and keeps schema metadata (SchemaField) so you can build higher-level typed mappers in your app.
QueryResult
columns: List<SchemaField>rows: List<List<dynamic>>(parsed from JSON)rowCount: intmessage: String?toMaps(): List<Map<String, dynamic>>
SchemaField
Column metadata includes flag helpers:
isPrimaryKey(flag containspk)isNonNull(flag containsnn)isUnique(flag containsuq)
Authentication models
LoginResponse
Returned by login(...) and refreshToken(...).
accessToken: StringrefreshToken: String?expiresAt: StringrefreshExpiresAt: String?user: LoginUserInfo
expiresAt and refreshExpiresAt are returned as strings (server-provided timestamps). Treat them as opaque unless you control the formatting.
Connection handlers
To receive lifecycle events, pass ConnectionHandlers to KalamClient.connect(...).
Callbacks include:
onConnect()onDisconnect(DisconnectReason reason)onError(ConnectionErrorInfo error)onReceive(String message)onSend(String message)onEvent(ConnectionEvent event)
Lifecycle event types:
ConnectEventDisconnectEventConnectionErrorEventReceiveEvent/SendEvent(debug hooks)
Subscription event types
subscribe(...) returns a Stream<ChangeEvent>.
Event classes:
AckEvent— includessubscriptionId,schema, and snapshot infoInitialDataBatch— initial snapshot rows, potentially in batchesInsertEventUpdateEventDeleteEventSubscriptionError
All row-bearing events expose parsed JSON maps (for example InsertEvent.row).
AckEvent and InitialDataBatch include snapshot batching fields (batchNum, hasMore, status).