ChatViewBuilders class

Visual builder / resolver overrides for ChatView.

Group all Widget Function(...), String Function(...) and similar factory-shaped slots so the ChatView constructor stays navigable. Every field is optional — the SDK falls back to sensible defaults when a slot is left null.

Constructors

ChatViewBuilders({Widget contextMenuBuilder(BuildContext, ChatMessage, bool)?, ReactionDetailSheetBuilder? reactionDetailSheetBuilder, Widget avatarBuilder(BuildContext context, String userId)?, String systemMessageTextResolver(ChatMessage message)?, Widget? systemMessageBuilder(BuildContext context, ChatMessage message)?, Widget? headerBuilder(BuildContext context)?, Widget blockedBannerBuilder(BuildContext context, VoidCallback onUnblock)?, WidgetBuilder? notParticipatingBannerBuilder, String? displayNameResolver(String userId)?, String? avatarUrlResolver(String userId)?, UserFetcher? userFetcher, BatchUserFetcher? batchUserFetcher, ValueListenable<double>? audioUploadProgressFor(String messageId)?, ValueListenable<double>? attachmentUploadProgressFor(String messageId)?, ValueListenable<bool>? attachmentUploadCancellableFor(String messageId)?, LinkPreviewFetcher? linkPreviewFetcher, Listenable? avatarRebuildSignal, MessageStatusIconBuilder? statusIconBuilder, AttachmentUrlResolver? attachmentUrlResolver, AttachmentMediaLoader? attachmentMediaLoader, CameraVideoPreviewBuilder? videoPreviewBuilder, Widget blockedMessageBuilder(BuildContext context, ChatMessage message)?, EmptyRoomBuilder? emptyRoomBuilder})
const

Properties

attachmentMediaLoader AttachmentMediaLoader?
Fetches an attachment's bytes (or a local file) through the authenticated client for media bubbles to render from — required because the download endpoints are Bearer-protected and no URL-loading widget (CachedNetworkImage, UrlSource, a video player) ever sends that header. null (default via ChatView) disables authenticated media loading; NomaChatView wires the adapter's default AuthenticatedAttachmentLoader automatically when this is left unset.
final
attachmentUploadCancellableFor ValueListenable<bool>? Function(String messageId)?
Per-message resolver that reports whether the upload behind attachmentUploadProgressFor can still be aborted — the signal behind the cancel X painted inside the ring. Returning null means there is no send in flight for that id.
final
attachmentUploadProgressFor ValueListenable<double>? Function(String messageId)?
Per-message resolver that returns an upload progress notifier (0..1) for an outgoing photo/video/file attachment still being uploaded — the audioUploadProgressFor counterpart for every attachment type that isn't a recorded voice clip. Defaults (when null, the default ChatView/NomaChatView wiring) to ChatUiAdapter.attachmentUploadProgressFor so the placeholder + progress ring shows up out of the box without the host wiring anything.
final
attachmentUrlResolver AttachmentUrlResolver?
Resolves a fresh download URL per attachment message so media bubbles re-mint on expiry instead of trusting a persisted URL forever. null (default via ChatView) keeps every bubble on the plain ChatMessage.attachmentUrl path. NomaChatView wires the adapter's default SignedAttachmentUrlResolver automatically when this is left unset.
final
audioUploadProgressFor ValueListenable<double>? Function(String messageId)?
Per-message resolver that returns an upload progress notifier (0..1) for outgoing voice messages still being uploaded. Returning null means there is no upload in flight for that message id.
final
avatarBuilder Widget Function(BuildContext context, String userId)?
Overrides the small avatar rendered next to incoming bubbles in group chats. Receives the BuildContext and the sender id.
final
avatarRebuildSignal Listenable?
Optional Listenable (typically adapter.userCacheListenable) that the message list listens to in order to repaint when the resolved displayName / avatarUrl of any member changes. Without it, an avatar updated from another device propagates to the adapter cache but the bubble keeps rendering the stale image until the controller emits its own change.
final
avatarUrlResolver String? Function(String userId)?
Optional sync resolver from userId → avatar URL. Forwarded to MessageList.avatarUrlResolver. Wire it to ChatUIAdapter.findCachedUser(id)?.avatarUrl for the same reason as displayNameResolver.
final
batchUserFetcher BatchUserFetcher?
Optional batched alternative to userFetcher: resolves every unique reactor in a single call instead of one request per reactor. When non-null, the reaction detail sheet prefers this over userFetcher. Wire it to a host-side bulk user-lookup endpoint to avoid an N+1 fan-out when a message has many distinct reactors.
final
blockedBannerBuilder Widget Function(BuildContext context, VoidCallback onUnblock)?
Optional override for the blocked-state banner. Receives the BuildContext and an onUnblock callback the consumer should invoke when the user taps. When null, the SDK renders the default banner.
final
blockedMessageBuilder Widget Function(BuildContext context, ChatMessage message)?
Replaces the built-in placeholder painted in place of a blocked sender's message under BlockedContentPolicy.placeholder. Receives the message that was pruned so a host can shape its own row; return null to fall back to the SDK pill.
final
contextMenuBuilder Widget Function(BuildContext, ChatMessage, bool)?
Overrides the bubble long-press / right-click context menu. When null, the SDK shows MessageContextMenu populated from ChatViewBehaviors.contextMenuActions.
final
displayNameResolver String? Function(String userId)?
Optional sync resolver from userId → display name. Forwarded to MessageList.displayNameResolver. Wire it to ChatUIAdapter.displayNameFor so incoming group bubbles label senders consistently with the rest of the chat UI.
final
emptyRoomBuilder EmptyRoomBuilder?
Builds what a room with no messages shows. The SDK owns the slot — where it sits, when it appears, what it falls back to — and the host owns the content: the plan the room was opened about, who organizes it, the actions that belong next to it. Return null for a room you have nothing to say about and the SDK's own card (DefaultEmptyRoomState) is drawn instead.
final
hashCode int
The hash code for this object.
no setterinherited
headerBuilder Widget? Function(BuildContext context)?
Optional widget rendered above the message list (e.g. info banner, quick-replies bar). Returning null skips the slot.
final
linkPreviewFetcher LinkPreviewFetcher?
Optional shared link-preview fetcher. When null and link previews are enabled, the composer creates its own internal fetcher.
final
notParticipatingBannerBuilder WidgetBuilder?
Optional override for the not-participating banner. When null, the SDK renders its default banner.
final
reactionDetailSheetBuilder ReactionDetailSheetBuilder?
Optional presenter for the reaction detail sheet. Lets the host app wrap the SDK-built sheet content in its own bottom sheet (theme, drag handle, safe-area padding, etc.). When null, the SDK falls back to a vanilla showModalBottomSheet with the chat theme's rounded shape.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusIconBuilder MessageStatusIconBuilder?
Overrides the delivery-status icon (sending/sent/delivered/read/failed) rendered on outgoing bubbles and, for the last message, on the corresponding RoomListView tile. Equivalent to theme.bubble.statusIconBuilder but discoverable alongside every other ChatView override; takes priority over the theme slot when both are set. Return null from the builder for a given state to fall back to the theme slot, then the SDK default.
final
systemMessageBuilder Widget? Function(BuildContext context, ChatMessage message)?
Replaces the default system-message row entirely. Returning null from this builder falls back to the SDK's default rendering, which starts with systemMessageTextResolver — this builder is consulted first, so wiring both means this one decides.
final
systemMessageTextResolver String Function(ChatMessage message)?
Custom text for system messages. Wins over the default text when it returns a string, but systemMessageBuilder is consulted first and replaces the row entirely when it returns a widget — the full precedence is systemMessageBuilder > this > localizedSystemMessageText
final
userFetcher UserFetcher?
Async resolver used by the reaction detail sheet to fetch the profile (display name + avatar) of every user that reacted.
final
videoPreviewBuilder CameraVideoPreviewBuilder?
Replaces the playable preview of a clip on the in-app camera's review step — the confirmation between the shutter and the send. null (the default) uses CameraVideoPreview, which is the SDK's only use of the video_player dependency: wire this to a player the host app already ships, or to something cheaper than a decoder, and nothing in the chat UI touches video_player any more.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited