ChatHeaderData class

The data + wired action callbacks passed to a ChatHeaderBuilder.

Each action callback is null when that action is unavailable in the current context — either disabled by dashboard/host config or not applicable in the current mode (e.g. onClose is null in full-page mode). A custom header should hide any control whose callback is null.

Constructors

ChatHeaderData({required BotConfiguration configuration, required String botName, required Widget avatar, required bool isOnline, required ThemeMode currentThemeMode, required Widget defaultHeader, VoidCallback? onClose, VoidCallback? onClearHistory, VoidCallback? onExportChat, void onChangeLanguage(String locale)?, void onChangeTheme(ThemeMode mode)?})
const

Properties

avatar → Widget
A ready-to-use bot avatar widget (the same one the built-in header renders). Drop it straight into a custom header.
final
botName → String
The resolved, localized bot name — already falls back to the localized "Assistant" label when the project hasn't set a name.
final
configuration → BotConfiguration
The live, merged bot configuration (name, colours, feature flags, …).
final
currentThemeMode → ThemeMode
The active theme mode — drives the selected state of a custom theme control.
final
defaultHeader → Widget
The SDK's built-in header, so a builder can reuse it wholesale or wrap it, e.g. headerBuilder: (ctx, data) => Banner(child: data.defaultHeader).
final
hashCode → int
The hash code for this object.
no setterinherited
isOnline → bool
Whether the backend health check currently reports the bot as online. Rebuilds the header live when the status flips.
final
onChangeLanguage → void Function(String locale)?
Switch the conversation language. Null when the language switch is off.
final
onChangeTheme → void Function(ThemeMode mode)?
Switch the light/dark theme. Null when the theme switcher is off.
final
onClearHistory → VoidCallback?
Clear the conversation history. Null when disabled via config.
final
onClose → VoidCallback?
Close/back the chat. Null in full-page mode (the chat can't be dismissed).
final
onExportChat → VoidCallback?
Export the transcript to the platform share sheet. Null when disabled.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

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