noma_chat library

Plug & play chat package for Flutter, backed by the Noma Chat backend.

Exposes three layers, each usable independently:

The typical entry point is NomaChat.create, which wires all three:

final chat = await NomaChat.create(
  baseUrl: 'https://chat.myapp.com/v1',
  realtimeUrl: 'https://chat.myapp.com',
  tokenProvider: () => authService.getToken(),
  currentUser: ChatUser(id: userId, displayName: name),
);
await chat.connect();

Classes

AggregatedReaction
An emoji reaction with its count and the list of users who reacted.
AttachmentPickers
Convenience entry points for the most common attachment flows in chat composers. Wraps image_picker and file_picker so consumers don't have to (re)wire them.
AttachmentPickerSheet
Bottom sheet with attach options.
AttachmentPickResult
ChatResult of an attachment picker call.
AttachmentPolicy
Declarative attachment-validation policy.
AttachmentPolicyViolation
Concrete rejection emitted by AttachmentPolicy.validate.
AttachmentsApi
REST implementation of ChatAttachmentsApi for uploading and downloading files plus listing per-room attachments.
AttachmentSheetOption
One row inside AttachmentPickerSheet. Used both for the built-in Camera/Gallery/File/Location options and to inject app-specific extras (e.g. "Send contact card", "Send poll", "Share plan").
AttachmentUploadResult
ChatResult of an attachment upload containing the server-assigned ID and optional URL.
AudioBubble
Bubble for a voice message: play/pause, waveform, duration, and optional upload-progress overlay while the audio is still being sent.
AudioPlaybackCoordinator
Coordinates exclusive playback across multiple AudioBubbles and chains auto-play to the next unlistened incoming voice note.
AuthApi
REST implementation of ChatAuthApi backed by the SDK's HTTP client.
AuthFailure
Authentication failed (401). Token may be expired or invalid.
AvatarCropPage
Square-aspect-ratio crop using image_cropper's native UIs (TOCropViewController on iOS, UCrop on Android). The picked image is dumped to a temp file because the plugin only operates on file paths, then re-read as bytes for the SDK upload pipeline.
AvatarPicked
AvatarPickerCancelled
AvatarPickerField
Composable circular avatar with an "edit" affordance overlaid. Tapping the avatar opens AvatarPickerSheet and, on success, holds the picked bytes in internal state so the caller can read them on submit.
AvatarPickerOutcome
Outcome surfaced by AvatarPickerSheet.show. Picked carries the post-crop bytes ready for upload; Removed is the "clear photo" signal; Cancelled is the dismissal default.
AvatarPickerSheet
WhatsApp-style bottom sheet for selecting a profile or group photo. Shows Camera / Gallery / View / Remove rows; the last two appear only when initialAvatarUrl is non-null. Selections from camera or gallery are routed through AvatarCropPage for a square crop before returning. Cancelling at any step yields AvatarPickerCancelled.
AvatarRemoved
AvatarSnapshot
In-memory image bytes plus mime type, ready for upload through AvatarStorage. Produced by AvatarPickerSheet after the user crops their selection.
AvatarStorage
Pluggable storage backend for profile and room avatars.
BlockedChatBanner
Replaces the composer when the local user has blocked the other party in a DM. WhatsApp-style: the chat stays open with full history, but the input is swapped for a tappable bar that surfaces the block and offers an immediate unblock.
BlockedUsersView
Lists the contacts the current user has blocked, with per-row "Unblock" action that confirms before calling client.contacts.unblock(userId).
BroadcastEvent
BulkPresenceResponse
Response from a bulk presence query containing the user's own presence and contacts.
CachedMessagesApi
Cache-aware decorator over RestMessagesApi.
ChatAttachmentsApi
File upload, download, and per-room attachment management.
ChatAuthApi
Server health and authentication checks.
ChatBubbleTheme
Theme for the message bubble surface — the rounded card that wraps every regular message, regardless of payload (text / attachment / reply / etc.).
ChatClient
Entry point for all chat operations.
ChatConfig
Configuration for a ChatClient instance.
ChatContact
A contact in the user's contact list, identified by user ID.
ChatContactsApi
Contact list, direct messaging, typing indicators, and blocking.
ChatContactsController
Contact / blocked-users operations exposed by ChatUiAdapter.contacts.
ChatController
Manages the state of a single chat conversation: messages, typing indicators, reactions, receipts, reply/edit state, and pagination.
ChatCursorPaginationParams
Cursor-based pagination using before/after timestamps (ISO 8601).
ChatDmController
Direct-message helpers exposed by ChatUiAdapter.dm.
ChatError
Lightweight error type emitted by UI controllers when SDK calls fail.
ChatEvent
A real-time event received from the chat server.
ChatFailure
Base class for all SDK failure types.
ChatFailureResult<T>
A failed result containing a ChatFailure describing what went wrong.
ChatInputTheme
Theme for the message composer — text field, send / attach / voice / camera buttons, editing banner and reply preview. Captures every visual surface that lives between the conversation and the keyboard.
ChatLocalDatasource
Contract for local data persistence in the chat SDK.
ChatMarkdownTheme
Theme for the inline-markdown styles applied by parseMarkdown inside text bubbles. Each token type maps to a single TextStyle that inherits from the bubble's base text style — only override the deltas (color, weight, decoration) for best results.
ChatMembersApi
Room membership: invitations, removal, bans, and role management.
ChatMessage
A chat message with text, attachments, reactions, and metadata.
ChatMessagesApi
Messaging: send, edit, delete, receipts, typing, threads, reactions, pins, search, scheduling.
ChatMessagesController
Per-message domain operations exposed by ChatUiAdapter.messages.
ChatPaginatedResponse<T>
A page of results with a flag indicating whether more data is available.
ChatPaginationParams
Offset-based pagination parameters.
ChatPresence
A user's online presence with status and last-seen timestamp.
ChatPresenceApi
Presence management for the current user and contacts.
ChatProfileController
Current-user profile operations exposed by ChatUiAdapter.profile.
ChatResult<T>
Represents the outcome of an SDK operation: either ChatSuccess with data or ChatFailureResult with a ChatFailure.
ChatRoom
A chat room with its basic metadata and member list.
ChatRoomAppBar
Drop-in AppBar for a chat room.
ChatRoomListTheme
Theme for the room list — tiles, unread badges, presence dots, search bar, suggestions strip and section headers.
ChatRoomOption
One entry in the ChatRoomOptionsMenu bottom sheet. Construct directly for fully custom options, or use one of the named factories (ChatRoomOption.clearChat, ChatRoomOption.deleteChat) for the WhatsApp-style presets.
ChatRoomOptionConfirmation
Confirmation dialog config attached to a ChatRoomOption. When present, ChatRoomOptionsMenu shows the dialog after the user taps the option; the action only fires if the user confirms.
ChatRoomOptionsMenu
Bottom sheet with chat-room actions (clear, delete, mute, pin, …).
ChatRoomsApi
Room lifecycle: creation, listing, discovery, configuration, and user preferences.
ChatRoomsController
Room-level operations exposed by ChatUiAdapter.rooms.
ChatSuccess<T>
A successful result containing data.
ChatTheme
Theming configuration for all chat UI components widgets.
ChatUiAdapter
Context handed to a RoomTitleResolver when the adapter (re)computes the effective title for a room. detail and otherMembers may be empty/null during incremental enrichments (e.g. before the DM contact has been resolved) — a robust resolver should tolerate that and either return null (to defer) or operate on currentItem only.
ChatUiLocalizations
Localized strings for all chat UI components widgets.
ChatUser
A chat platform user with profile information and role.
ChatUsersApi
User search, creation, profile updates, and managed-user operations.
ChatView
All-in-one chat screen body: message list + composer + optional banners.
ChatViewBehaviors
Pure data / boolean configuration for ChatView — anything that changes appearance or behaviour but is not a callback or builder.
ChatViewBuilders
Visual builder / resolver overrides for ChatView.
ChatViewCallbacks
Imperative callbacks fired by ChatView in response to user interactions (send, edit, delete, reactions, attachments, …).
ConflictFailure
Resource already exists or conflicts with current state (409).
ConnectedEvent
ConnectionBanner
Horizontal banner showing the current connection state (connecting, reconnecting, disconnected, error).
ContactsApi
REST implementation of ChatContactsApi (contacts list + DMs + block list).
ContactSuggestionsBar
Horizontal strip of suggested contacts shown above the chat list as a shortcut to start a new conversation.
ContentFilterFailure
Message blocked by a server-side content filter (400).
DateFormatter
Date/time formatting helpers used by the UI components (date separators, timestamps in bubbles, last-message previews). Locale comes from ChatUiLocalizations.
DateSeparator
Centered date pill inserted between groups of messages on different days.
DefaultAvatarStorage
Default AvatarStorage backed by ChatClient.attachments.upload. The chat backend persists the bytes through whatever attachment module is configured (CHT GFS, inline collection, S3 module, …) and returns the reachable URL. delete is a no-op (CHT attachments aren't deletable today) and thumbnailUrl returns null (no transform pipeline).
DefaultPalette
Hardcoded fallback colors used when a ChatTheme field is left as null. Centralized here so the look-and-feel stays consistent across widgets that don't share a theme field (banners, separators, muted UI rows).
DisconnectedEvent
DiscoveredRoom
A public room found via discovery search.
DmActivityEvent
DocsListView
Displays a list of document attachments (PDFs, docs, spreadsheets, archives, generic files). Audio attachments are excluded by default to mirror WhatsApp's "Docs" tab behaviour.
EmptyState
Placeholder widget shown when a list (messages or rooms) is empty.
ErrorEvent
FileBubble
Bubble for a generic file attachment: shows name + size + open action.
FloatingReactionPicker
Floating overlay that shows predefined reactions near a message.
ForbiddenFailure
User lacks permission for the requested operation (403).
ForwardedBubble
Decorates child with a "Forwarded" header and optional source room label, used when the underlying message was forwarded from another room.
ForwardInfo
Metadata about a forwarded message: original sender, room, and message ID.
FullEmojiPicker
Full emoji picker shown as a bottom sheet.
GroupCreationResult
Result of a successful group creation. Returned by GroupSetupPage.show so the caller can navigate straight into the newly-minted room.
GroupInfoPage
WhatsApp-style unified "Group info" page. Replaces the older GroupInfoEditSheet (avatar+name only) and GroupMembersView (members only) by stacking both in a single full-screen flow:
GroupMembersView
Members management view for a group room. Loads the current member list via the SDK adapter, sorts owner → admin → member (alphabetical inside each tier), and exposes per-row actions for admins:
GroupSetupPage
WhatsApp-style "new group" screen — single-page flow that gathers avatar, name, optional description and the member list in one place. The classic two-step flow (pick members → name the group) remains supported by pre-populating initialMembers; consumers that want the unified flow can leave it empty and let the user pick inside this page.
HealthStatus
Server health status with individual service check results.
HiveAesCipher
Default encryption algorithm. Uses AES256 CBC with PKCS7 padding.
HiveChatDatasource
Persistent ChatLocalDatasource implementation backed by Hive CE.
HiveCipher
Abstract cipher can be implemented to customize encryption.
ImageBubble
Bubble that renders an image attachment with cached network loading and tap-to-open behavior.
ImageViewer
Full-screen image viewer with pinch-to-zoom, used when tapping an image bubble or gallery thumbnail.
InvitedRoom
A pending room invitation showing who invited the current user.
LinkPreviewBubble
Bubble decoration that renders the OpenGraph-style preview of a link (image, title, description) above the underlying text bubble.
LinkPreviewCacheStats
Snapshot of LinkPreviewFetcher's in-memory LRU + failure-TTL caches, plus running counters of how the cache has been used since process start.
LinkPreviewFetcher
Fetches Open Graph metadata for URLs typed in the chat composer.
LinkPreviewMetadata
Open Graph / oEmbed-like metadata extracted from a URL. The chat composer fetches it on the fly while the user types and embeds it in the outgoing message so the receiver renders the same preview without re-fetching.
LinksListView
Lists URLs extracted client-side from regular text messages. Designed for the "Links" tab of MediaGalleryPage, where the surface is intentionally limited to messages already present in the local cache (no extra round trip).
LocationBubble
Bubble for a shared location: shows a static map preview centered on the coordinates and opens the system maps app on tap.
MarkdownSpan
One contiguous slice of text emitted by parseMarkdown, carrying its style and (for links/mentions) the target URL or user id.
MediaGalleryPage
WhatsApp-style "Shared in this chat" page with three tabs: Media, Docs and Links. Voice notes and audio attachments are excluded by default.
MediaGalleryView
Grid view of MediaItems, used as the Media tab of MediaGalleryPage.
MediaItem
One entry shown in MediaGalleryView: a remote URL plus optional timestamp/sender/file metadata.
MemberEntry
A user paired with their per-room RoomRole, shown in MemberListView.
MemberListView
Sorted list of members for a room; offers role badges and admin actions (kick/promote) gated on the caller's currentUserRole.
MemberPickerSheet
Bottom-sheet contact picker designed to drive the "Add members" flow of a group room. Multi-select with confirm button.
MembersApi
REST implementation of ChatMembersApi.
MentionOverlay
Floating list of matching users displayed above the composer when the user types @; tapping inserts the mention.
MessageBubble
Renders a single message as a styled bubble with support for text, images, audio, video, files, link previews, forwarded labels, reactions, receipts, and threads.
MessageContextMenu
Long-press context menu for a single message: returns the selected MessageAction (or null if dismissed).
MessageDeletedEvent
MessageForwardSheet
"Forward to…" picker.
MessageInput
Composer for the chat: text field, attach/voice buttons, reply preview and editing affordances. Reads/edits state through the bound ChatController and reports user actions via the on… callbacks.
MessageInputVoiceController
High-level state machine of the voice recorder gesture inside the composer. Wraps the lower-level VoiceRecordingController and adds:
MessageList
Scrollable list of message bubbles with date separators, typing indicator, scroll-to-bottom button, and automatic pagination on scroll.
MessagePin
A pinned message reference with who pinned it and when.
MessageReport
A moderation report filed against a message.
MessageSearchController
Controller for searching messages within a room, with loading state and pagination.
MessageSearchView
Full-text search UI for messages within a room, with debounced input and result tapping.
MessageStatusIcon
Small check-icon stack indicating the ReceiptStatus of an outgoing message (sent / delivered / read).
MessageUpdatedEvent
NetworkFailure
Network is unreachable or the connection was lost.
NewMessageEvent
NomaChat
Plug & play entry point for Noma Chat.
NomaChatClient
Default ChatClient implementation.
NotFoundFailure
Requested resource does not exist (404).
NotParticipatingBanner
Replaces the composer when the local user has been kicked from a group (RoomListItem.isParticipating == false). WhatsApp-style: non-interactive informational copy — the chat above stays fully browsable but the input is gone.
OfflineQueuedMessagesApi
Offline-queue decorator on top of CachedMessagesApi.
OperationError
Single error event broadcast by ChatUiAdapter.operationErrors whenever any adapter method fails. The original ChatResult.ChatFailureResult is still returned to the caller; this stream is for cross-cutting concerns like global snackbars or telemetry.
OperationFeedbackListener
Listens to a Stream<OperationSuccess> (typically chatAdapter.operationSuccesses) and shows localized SnackBars confirming user-visible operations — pin a message, delete a message, forward, etc.
OperationSuccess
Mirror of OperationError for successful operations the consumer might want to confirm to the user (snackbar/toast/etc). Emitted on ChatUiAdapter.operationSuccesses when an operation that has user-visible side effects (pin a message, delete a message, forward, mute a room, report, …) completes successfully.
PendingChatMessage
A locally-persisted outgoing message that has not been confirmed by the server. isFailed is true when the last send attempt returned an error; when false, the message is still pending (in flight or queued).
PinnedMessagesBanner
Banner displayed at the top of a chat view showing the current pinned message.
PollingConfig
Knobs for RealtimeMode.polling. Passed via ChatConfig.pollingConfig (defaults to PollingConfig() when polling is selected without an explicit instance).
PresenceApi
REST implementation of ChatPresenceApi; online state is reported via real-time events, this API only handles polled snapshots and the current user's status update.
PresenceChangedEvent
ProfileSettingsPage
WhatsApp-style "My profile" page: large avatar at the top with edit-on-tap (commits immediately) and a batch-edit form for display name + optional bio/email that surfaces a Save action in the AppBar. The Save button stays disabled until at least one tracked field has pending changes and re-disables itself while the request is in flight.
QuickRepliesBar
Horizontal row of one-tap reply chips above the composer.
RateLimitFailure
Too many requests (429). Check retryAfter for the suggested wait time.
ReactionAddedEvent
ReactionBar
Horizontal pill bar showing per-emoji counts under a message bubble.
ReactionDeletedEvent
ReactionDetailContent
Content of the reaction detail sheet (tabs per emoji + user list). Public so consumers can embed it inside their own bottom sheet wrapper via ReactionDetailSheet.show's sheetBuilder parameter.
ReactionDetailSheet
Bottom sheet that lists every user who reacted to a message, grouped by emoji. Use the static show entry point.
ReactionPicker
Row of selectable emoji used to add a reaction to a message.
ReactionUser
Lightweight user model for reaction detail display.
ReadReceipt
A read receipt indicating the last message read by a user.
ReadReceiptAvatars
Displays a row of small user avatars representing who has read a message.
ReceiptUpdatedEvent
ReplyPreview
Compact preview of the message being replied to. Shown inside reply bubbles and above the composer while drafting a reply.
RestMessagesApi
REST-only implementation of ChatMessagesApi. The plain network layer with no cache integration and no offline queue — both live in dedicated decorators (CachedMessagesApi, OfflineQueuedMessagesApi) so each concern stays cohesive and independently testable.
RoomConfig
Room-level configuration flags.
RoomContextMenu
Long-press context menu for a room: returns the selected RoomAction (or null if dismissed).
RoomCreatedEvent
RoomDefaults
Sensible defaults for room creation / membership flows and UX timing.
RoomDeletedEvent
RoomDetail
Detailed room information including the current user's role and room configuration.
RoomListController
Manages the list of rooms displayed in RoomListView.
RoomListHeader
Title bar at the top of RoomListView with optional selection mode UI and trailing action slot.
RoomListItem
View model for a row in the room list, combining server-side room metadata with client-side state (unread, presence, typing, etc.).
RoomListView
Displays a filterable, selectable list of chat rooms with header, search bar, pull-to-refresh, and context menu support.
RoomsApi
REST implementation of ChatRoomsApi with optional cache pass-through.
RoomSearchBar
Debounced text field used to filter the room list by name.
RoomTile
A single row in the room list showing avatar, name, last message preview, timestamp, unread badge, and muted/pinned indicators.
RoomTitleContext
Snapshot of the data the SDK has about a room when it needs to pick a title. Passed to RoomTitleResolver so consumers can build app-specific naming.
RoomUpdatedEvent
RoomUser
A member of a room with their assigned role.
ScheduledMessage
A message scheduled to be sent at a future time.
ScrollToBottomButton
Floating action button that appears when the user scrolls up in the message list, optionally showing an unread badge.
SendMessageRequest
Payload describing a send action initiated from the composer.
ServerFailure
Server returned a 5xx error.
A single shared link with its origin metadata.
StableUserId
Persists a stable opaque id per typed display name.
StorageFailure
Avatar/image-storage backend failure (custom AvatarStorage implementations or the default attachment-backed one). Keep cause populated when possible so the host app can decide whether to retry, log, or surface a localized error.
SuggestedContact
Lightweight projection of a user shown in ContactSuggestionsBar — just enough to render an avatar with name and presence dot.
SuggestionBarController
Drives the "suggestion bar" surface (chips above the chat list of users the local user is likely to message). Merges two discovery sources:
SwipeToReply
Wraps a bubble so a short horizontal swipe triggers onSwipe, used to start a reply via gesture instead of the context menu.
TextBubble
Bubble that renders a plain or markdown-inlined text message with the sender label, timestamp and receipt status.
ThreadView
Displays a message thread: the parent message, its replies, and an input for new replies.
TimeoutFailure
The operation exceeded the configured timeout.
TypingIndicator
Animated three-dot bubble shown when one or more other users are typing.
TypingStatusText
Displays a localized "X is typing..." label based on ChatController.typingUserIds.
UnexpectedFailure
An unexpected error that doesn't fit other failure types. Check originalError for the root cause.
UnreadBadge
Small numeric badge clamped to maxCount (shown as 99+ past the cap). Used in room tiles and the scroll-to-bottom button.
UnreadDivider
WhatsApp-style "N new messages" divider rendered above the first unread message when a chat is opened with pending messages.
UnreadRoom
A room with its unread count and last message preview.
UnreadUpdatedEvent
UrlDetector
UserActivityEvent
UserAvatar
Circular user avatar with initials fallback and optional online/presence indicator dot.
UserConfiguration
User-level configuration including webhook settings and custom metadata.
UserInfoPage
Read-only WhatsApp-style "User info" page for a peer in a DM. Shows the large avatar, display name and bio when present. Loaded by userId through the adapter's user cache + REST fallback.
UserJoinedEvent
UserLeftEvent
UserProfileView
Profile sheet for a single user: avatar, display name, presence and quick actions (DM, mute, block) supplied by the host app.
UserRoleChangedEvent
UserRooms
The current user's rooms and pending invitations.
UsersApi
REST implementation of ChatUsersApi with optional cache pass-through.
UserUpdatedEvent
ValidationFailure
Request parameters are invalid (400). Check errors for field-level details.
VideoBubble
Bubble that renders a video thumbnail with a play overlay; tap to open.
VoiceGestureThresholds
Drag thresholds for the slide-to-cancel / slide-to-lock gesture inside the composer. Matched against the long-press localOffsetFromOrigin cumulative offset.
VoiceMessageData
Output of VoiceRecordingController when a recording is finalised: raw audio bytes, duration, downsampled waveform and MIME type, ready to hand to sendVoiceMessage.
VoiceRecorderButton
Visual mic button for chat composers. Recording itself is owned by the composer (see MessageInput), which detects long-press gestures and delivers the resulting VoiceMessageData via its onVoiceMessageReady callback. This widget is purely a circular mic icon with semantics.
VoiceRecorderOverlay
Full-width overlay rendered above the composer while recording or previewing a voice message; bound to a VoiceRecordingController.
VoiceRecordingController
Drives the voice-message recorder UI: permission flow, recording state, amplitude sampling for the waveform, and pre-listen playback.
WaveformDisplay
Static waveform painter: bars from a list of amplitude samples with a progress indicator. Used in audio bubbles and the recorder preview.
WebhookConfig
Webhook configuration for server-to-server notifications.

Enums

AttachmentPolicyViolationKind
Categorical reasons for an attachment policy rejection.
AvatarKind
Identifies the kind of avatar being uploaded so backends that want to segment storage (e.g. /avatars/users/<id>.jpg vs /avatars/rooms/<id>.jpg) can route accordingly. Pure metadata — the default storage ignores it.
CachePolicy
Determines how reads are resolved between network and local cache.
ChatActivity
Typing indicator activity sent to a room or DM.
ChatConnectionState
The state of the real-time connection.
ChatErrorType
Classification of a ChatError. Use it to decide whether to retry, surface a validation message, or treat the error as opaque.
ChatSortOrder
Ordering hint for paginated queries. Most message and room listings use desc (newest first) by default.
MarkdownStyle
Inline markdown roles recognised by parseMarkdown.
MediaItemType
Kind of media listed in the gallery.
MessageAction
Actions available in the long-press menu of a message. The host app filters this set via ChatView.contextMenuActions.
MessageType
Discriminator for a ChatMessage's payload. Bubbles in the UI components branch on this value to pick the right renderer.
MimeKind
Broad payload kinds the SDK distinguishes when previewing or grouping attachments. Resolved from the MIME type — see classifyMime.
OperationKind
Identifies which adapter operation produced an OperationError. Hosts typically branch on this in their snackbar/toast logic.
PresenceStatus
Per-user presence states reported by the backend. The UI components only distinguishes online (any non-offline) vs offline; the granular states are exposed for apps that want to render them.
RealtimeMode
How the SDK should establish its real-time channel against the backend. Selected via ChatConfig.realtimeMode.
ReceiptStatus
Delivery state of an outgoing message as reported by the backend. Read receipts can advance from sent to delivered to read.
RoomAction
Actions available in the long-press menu of a room tile.
RoomAudience
Who can discover and join a room.
RoomRole
Room-level role. The backend wire format uses "user" for member.
RoomType
Conversation shape. oneToOne rooms hold exactly two users and never promote to a group; announcement rooms are read-only for non-admins.
RoomUserMode
Behavior for ChatMembersApi.invite: invite without joining, accept / decline a pending invitation, or invite-and-join atomically.
ServiceStatus
Outcome of a backend health check. degraded means the server responded but some sub-systems are unhealthy.
StartRecordingResult
ChatResult of VoiceRecordingController.startRecording.
UserRole
Global privilege level a user holds in the chat backend.
VoiceRecordingState
Finite state machine of the voice recorder.
WebhookAuthType
Authentication scheme expected by an outgoing webhook target.

Extensions

AggregatedReactionPatterns on AggregatedReaction
Adds pattern-matching-related methods to AggregatedReaction.
AttachmentUploadResultPatterns on AttachmentUploadResult
Adds pattern-matching-related methods to AttachmentUploadResult.
BulkPresenceResponsePatterns on BulkPresenceResponse
Adds pattern-matching-related methods to BulkPresenceResponse.
ChatBubbleThemePatterns on ChatBubbleTheme
Adds pattern-matching-related methods to ChatBubbleTheme.
ChatContactPatterns on ChatContact
Adds pattern-matching-related methods to ChatContact.
ChatInputThemePatterns on ChatInputTheme
Adds pattern-matching-related methods to ChatInputTheme.
ChatMarkdownThemePatterns on ChatMarkdownTheme
Adds pattern-matching-related methods to ChatMarkdownTheme.
ChatMessagePatterns on ChatMessage
Adds pattern-matching-related methods to ChatMessage.
ChatPresencePatterns on ChatPresence
Adds pattern-matching-related methods to ChatPresence.
ChatRoomListThemePatterns on ChatRoomListTheme
Adds pattern-matching-related methods to ChatRoomListTheme.
ChatRoomPatterns on ChatRoom
Adds pattern-matching-related methods to ChatRoom.
ChatThemePatterns on ChatTheme
Adds pattern-matching-related methods to ChatTheme.
ChatUserPatterns on ChatUser
Adds pattern-matching-related methods to ChatUser.
DiscoveredRoomPatterns on DiscoveredRoom
Adds pattern-matching-related methods to DiscoveredRoom.
ForwardInfoPatterns on ForwardInfo
Adds pattern-matching-related methods to ForwardInfo.
HealthStatusPatterns on HealthStatus
Adds pattern-matching-related methods to HealthStatus.
InvitedRoomPatterns on InvitedRoom
Adds pattern-matching-related methods to InvitedRoom.
MessagePinPatterns on MessagePin
Adds pattern-matching-related methods to MessagePin.
MessageReportPatterns on MessageReport
Adds pattern-matching-related methods to MessageReport.
PendingChatMessagePatterns on PendingChatMessage
Adds pattern-matching-related methods to PendingChatMessage.
ReadReceiptPatterns on ReadReceipt
Adds pattern-matching-related methods to ReadReceipt.
RoomConfigPatterns on RoomConfig
Adds pattern-matching-related methods to RoomConfig.
RoomDetailPatterns on RoomDetail
Adds pattern-matching-related methods to RoomDetail.
RoomListItemPatterns on RoomListItem
Adds pattern-matching-related methods to RoomListItem.
RoomUserPatterns on RoomUser
Adds pattern-matching-related methods to RoomUser.
ScheduledMessagePatterns on ScheduledMessage
Adds pattern-matching-related methods to ScheduledMessage.
UnreadRoomPatterns on UnreadRoom
Adds pattern-matching-related methods to UnreadRoom.
UserConfigurationPatterns on UserConfiguration
Adds pattern-matching-related methods to UserConfiguration.
UserRoomsPatterns on UserRooms
Adds pattern-matching-related methods to UserRooms.
WebhookConfigPatterns on WebhookConfig
Adds pattern-matching-related methods to WebhookConfig.

Functions

buildLastMessagePreview(RoomListItem item, ChatUiLocalizations l10n, {String? currentUserId}) String?
Builds a WhatsApp-style preview text for the last message of a room.
buildMessagesApi({required RestClient rest, TransportManager? transport, ChatLocalDatasource? cache, CacheManager? cacheManager, OfflineQueue? offlineQueue, void logger(String level, String message)?}) ChatMessagesApi
Builds the right ChatMessagesApi chain for the supplied dependencies.
classifyMime(String? mime) MimeKind
Classifies a MIME type string into one of MimeKind. Centralised so MessageList previews, the room-list last-message preview and the media gallery all use the same buckets instead of re-implementing startsWith('image/') checks at each call site.
demoContactsFromEnvironment() List<String>
Reads DEMO_CONTACTS (comma-separated) from compile-time dart-defines. Returns the trimmed, non-empty entries. Empty list when the env var is missing — the suggestion bar then surfaces only roster contacts.
formatVoiceDuration(int durationMs) String
Formats durationMs as m:ss (e.g. 0:14, 1:23, 12:05).
initialsOf(String? name, {int maxChars = 2}) String
Returns up to maxChars initial letters of name. Uses Unicode-aware character iteration (via String.characters) so multi-code-unit graphemes (emoji, combining marks) stay intact.
parseMarkdown(String text, {required TextStyle baseStyle, TextStyle? boldStyle, TextStyle? italicStyle, TextStyle? codeStyle, TextStyle? strikethroughStyle, TextStyle? linkStyle, TextStyle? mentionStyle, ValueChanged<String>? onTapLink, ValueChanged<String>? onTapMention}) List<TextSpan>
readersFor(ChatMessage message, List<ReadReceipt> receipts) List<String>
Returns the ids of users (from receipts) who have read message.

Typedefs

IsDmRoomPredicate = bool Function(RoomDetail detail)
Predicate the adapter uses to decide whether a room is a DM and therefore should be tracked in the contact-to-room cache. When null, falls back to detail.type == RoomType.oneToOne.
ManagedUserConfiguration = UserConfiguration
MessageForwardConfirmBuilder = Widget Function(BuildContext context, List<String> selectedIds, VoidCallback onConfirm)
Signature for the confirm-button builder. Lets the consumer style or replace the default "Forward" button (e.g. swap to a FilledButton, add a count badge, render as a FAB, etc.).
MessageForwardEmptyCallback = void Function(BuildContext context)
Signature for the "no chats available" handler used by MessageForwardSheet.show BEFORE the modal opens. Fires when the caller's room list is empty — the consumer can navigate to a "New chat" page, show a dialog, etc. instead of the default snackbar.
MessageForwardRowBuilder = Widget Function(BuildContext context, RoomListItem room, bool isSelected, ValueChanged<bool> onToggle)
Signature for a per-row builder. Lets the consumer fully replace the default CheckboxListTile + avatar row with a custom widget.
OperationErrorLabelBuilder = String? Function(BuildContext context, OperationError event, ChatTheme theme)
Localized message for a failed operation. Returning null (or an empty string) suppresses the snackbar — the default only speaks up for expected moderation failures (content filter) and stays silent for everything else, so transient/network errors keep surfacing as failed-message bubbles rather than noisy toasts.
OperationSuccessLabelBuilder = String? Function(BuildContext context, OperationSuccess event, ChatTheme theme)
Localized message for a successful operation. Returning null (or an empty string) suppresses the snackbar for that event — consumers use this to opt out per-kind without disabling the listener.
ReactionDetailSheetBuilder = Future<void> Function(BuildContext context, Widget content)
Signature for a custom presenter of the reaction detail sheet. Receives the already-built content widget and is responsible for displaying it in the host app's preferred bottom sheet style. When null, ReactionDetailSheet falls back to a vanilla showModalBottomSheet.
RoomTitleResolver = String? Function(RoomTitleContext context)
Resolves the title shown for a room across the SDK (surfaced via RoomListItem.displayName and any consumer reading it). Returning null opts out and lets the SDK apply its default: for DMs the other member's displayName (falling back to their id); for groups the server-provided room.name. Use this hook to inject app-specific naming (e.g. nickname books, role-based titles) without forking the SDK or mutating room state.
UserFetcher = Future<ReactionUser> Function(String userId)
Callback that resolves a user ID into display information.

Exceptions / Errors

AvatarStorageException
Thrown by AvatarStorage implementations to signal upload/delete failures. The SDK surfaces it as a StorageFailure so UI layers can render a localized error message without inspecting the cause.