chat_widget library

Classes

BotConfiguration
Configuration for the chatbot widget behavior and appearance.
CarouselConfig
Configuration for carousel component.
ChatAppearance
Tenant-configurable chat-surface colours, mirrored from the backend chat_appearance block on /api/project/config/.
ChatColors
Customisation surface for the chat's visual palette.
ChatHeader
A header widget for the chat interface displaying bot information and controls.
ChatHeaderData
The data + wired action callbacks passed to a ChatHeaderBuilder.
ChatWidget
A floating action button that opens a chat interface with smooth animations.
ChatWidgetState
The state class for ChatWidget, managing chat interactions and animations.
FabConfiguration
Configuration for the floating action button (FAB) that opens the chat.
LocalizedText
Represents a localized text value with translations for different languages
OnTapCallback
Light-weight (callback_id, payload) pair used as the image-tap action on RichImage and ImageComponent. Distinct from RichAction because image taps never need a label or visual style — they just dispatch through the same host-supplied OnCustomCallback channel that buttons use.
ProductListConfig
Configuration for product list component.
RemoteConfig
Remote configuration fetched from the server.
RichAction
Base sealed class for all action types.
RichButton
Button data for button group component.
RichComponent
Base sealed class for all rich content components.
RichContentResponse
Response containing rich content components from the backend.
RichImage
Image data for cards and image components.
RichSwatch
Single swatch in a SwatchGridComponent.
SoundConfiguration
Configuration for chatbot sound effects.

Enums

ChatHeaderAction
Enum defining available actions in the chat header menu.
SoundEvent
Sound event types that can be triggered.

Extensions

BotConfigurationLocalization on BotConfiguration
BotConfigurationPatterns on BotConfiguration
Adds pattern-matching-related methods to BotConfiguration.
CarouselConfigPatterns on CarouselConfig
Adds pattern-matching-related methods to CarouselConfig.
ChatAppearancePatterns on ChatAppearance
Adds pattern-matching-related methods to ChatAppearance.
FabConfigurationPatterns on FabConfiguration
Adds pattern-matching-related methods to FabConfiguration.
LocalizedTextPatterns on LocalizedText
Adds pattern-matching-related methods to LocalizedText.
OnTapCallbackPatterns on OnTapCallback
Adds pattern-matching-related methods to OnTapCallback.
ProductListConfigPatterns on ProductListConfig
Adds pattern-matching-related methods to ProductListConfig.
RemoteConfigMapping on RemoteConfig
Single canonical mapping from the server/preview config shape (RemoteConfig) to the runtime BotConfiguration. Used by BOTH the real /api/project/config/ fetch (ChatRepository) AND the dashboard live-preview (web_embed parses the postMessage payload via RemoteConfig.fromJson then calls this). Keeping it in one place means a new server config field only has to be added to RemoteConfig
RemoteConfigPatterns on RemoteConfig
Adds pattern-matching-related methods to RemoteConfig.
RichActionPatterns on RichAction
Adds pattern-matching-related methods to RichAction.
RichButtonPatterns on RichButton
Adds pattern-matching-related methods to RichButton.
RichComponentPatterns on RichComponent
Adds pattern-matching-related methods to RichComponent.
RichContentResponsePatterns on RichContentResponse
Adds pattern-matching-related methods to RichContentResponse.
RichImagePatterns on RichImage
Adds pattern-matching-related methods to RichImage.
RichSwatchPatterns on RichSwatch
Adds pattern-matching-related methods to RichSwatch.
SoundConfigurationPatterns on SoundConfiguration
Adds pattern-matching-related methods to SoundConfiguration.

Typedefs

ChatHeaderBuilder = Widget Function(BuildContext context, ChatHeaderData data)
Signature for ChatWidget.headerBuilder — lets a host app render a fully custom chat header while still driving the SDK's data and actions.
ChatImageUploader = Future<String> Function(Uint8List bytes, String mimeType)
Signature for the host-provided image uploader. Called by ChatViewModel.sendMessage when the user attaches a photo and the host has wired ChatViewModel.imageUploader (or ChatWidget.imageUploader which forwards to it).
HostSlotBuilder = Widget? Function(String slotId, Map<String, dynamic>? payload)
Builder the host registers to render a host_slot component with its own native widget. The SDK calls it with the slot's slotId and payload (carried in the message JSON); return the widget to inline in the bubble.
OnCustomCallback = void Function(String callbackId, Map<String, dynamic>? payload)
Callback type for custom actions from rich content.