RemoteConfig constructor
const
RemoteConfig({
- required LocalizedText name,
- @JsonKey.new(name: 'welcome_message') required LocalizedText welcomeMessage,
- @JsonKey.new(name: 'system_instruction') required LocalizedText systemInstruction,
- @JsonKey.new(name: 'default_locale') @Default.new('en') String defaultLocale,
- @JsonKey.new(name: 'supported_locales') @Default.new(['en']) List<
String> supportedLocales, - @JsonKey.new(name: 'font_family') String? fontFamily,
- String? color,
- String? avatar,
- @JsonKey.new(name: 'fab_configuration') FabConfiguration? fabConfiguration,
- @JsonKey.new(name: 'chat_appearance') ChatAppearance? chatAppearance,
- @JsonKey.new(name: 'chat_appearance_dark') ChatAppearance? chatAppearanceDark,
- @JsonKey.new(name: 'show_theme_toggle') @Default.new(true) bool showThemeToggle,
- @JsonKey.new(name: 'default_theme_mode') @Default.new('system') String defaultThemeMode,
- @JsonKey.new(name: 'sound_configuration') SoundConfiguration? soundConfiguration,
- @JsonKey.new(name: 'enable_user_export') @Default.new(true) bool enableUserExport,
- @JsonKey.new(name: 'enable_clear_history') @Default.new(true) bool enableClearHistory,
- @JsonKey.new(name: 'enable_file_attach') @Default.new(true) bool enableFileAttach,
- @JsonKey.new(name: 'dynamic_language_enabled') @Default.new(false) bool dynamicLanguageEnabled,
- @JsonKey.new(name: 'ai_disclosure_enabled') @Default.new(true) bool aiDisclosureEnabled,
- @JsonKey.new(name: 'ai_disclosure_text') LocalizedText? aiDisclosureText,
- @JsonKey.new(name: 'ai_disclosure_require_ack') @Default.new(false) bool aiDisclosureRequireAck,
- @JsonKey.new(name: 'message_reporting_enabled') @Default.new(true) bool messageReportingEnabled,
- @JsonKey.new(name: 'ai_info_url') String? aiInfoUrl,
- @JsonKey.new(name: 'privacy_url') String? privacyUrl,
- @JsonKey.new(name: 'ai_data_reuse_notice') @Default.new(false) bool aiDataReuseNotice,
Implementation
const factory RemoteConfig({
/// Bot display name from server (localized).
required LocalizedText name,
/// Welcome message from server configuration (localized).
// ignore: invalid_annotation_target
@JsonKey(name: 'welcome_message') required LocalizedText welcomeMessage,
/// System instructions from server (localized).
// ignore: invalid_annotation_target
@JsonKey(name: 'system_instruction')
required LocalizedText systemInstruction,
/// Default locale from server
// ignore: invalid_annotation_target
@JsonKey(name: 'default_locale') @Default('en') String defaultLocale,
/// Supported locales from server
// ignore: invalid_annotation_target
@JsonKey(name: 'supported_locales')
@Default(['en'])
List<String> supportedLocales,
/// Font family setting from server. The backend emits snake_case
/// `font_family`; without this JSONKey the generated parser would read
/// `fontFamily` and always get null, silently falling back to 'Roboto'
/// no matter what font the tenant configured.
// ignore: invalid_annotation_target
@JsonKey(name: 'font_family') String? fontFamily,
/// Primary color setting from server.
String? color,
/// Avatar URL or data from server.
String? avatar,
/// FAB configuration from server.
// ignore: invalid_annotation_target
@JsonKey(name: 'fab_configuration') FabConfiguration? fabConfiguration,
/// Chat-surface appearance from server. When present, fields
/// override the SDK's MD3 defaults; when null/missing, the SDK
/// uses the ambient [ColorScheme].
// ignore: invalid_annotation_target
@JsonKey(name: 'chat_appearance') ChatAppearance? chatAppearance,
/// Dark-mode chat-surface appearance. Picked when the active theme
/// brightness is dark; null/missing → the SDK's MD3 dark defaults.
// ignore: invalid_annotation_target
@JsonKey(name: 'chat_appearance_dark') ChatAppearance? chatAppearanceDark,
/// Server gate for the light/dark theme switcher in the more-options
/// menu. When false the switcher is hidden; the host-supplied
/// [BotConfiguration] value still wins per the standard precedence.
// ignore: invalid_annotation_target
@JsonKey(name: 'show_theme_toggle') @Default(true) bool showThemeToggle,
/// Initial theme mode before the user overrides it locally — one of
/// 'light', 'dark', or 'system' (follows the host device brightness).
// ignore: invalid_annotation_target
@JsonKey(name: 'default_theme_mode')
@Default('system')
String defaultThemeMode,
/// Per-event sound config from server. Was previously dropped from
/// RemoteConfig (so dashboard sound settings only affected the live
/// preview, not the deployed widget) — now parsed so the canonical
/// config path carries it too.
// ignore: invalid_annotation_target
@JsonKey(name: 'sound_configuration')
SoundConfiguration? soundConfiguration,
/// Server-side gate for the in-chat "Export chat" menu item.
/// Hosts can toggle this from the dashboard to hide the action
/// without redeploying the widget. Defaults true to match the
/// chat-side default; the host-supplied [BotConfiguration] value
/// still wins per the standard precedence rules.
// ignore: invalid_annotation_target
@JsonKey(name: 'enable_user_export') @Default(true) bool enableUserExport,
/// Server-side gate for the in-chat "Clear chat history" menu item.
// ignore: invalid_annotation_target
@JsonKey(name: 'enable_clear_history')
@Default(true)
bool enableClearHistory,
/// Server-side gate for the paperclip attach button in chat input.
// ignore: invalid_annotation_target
@JsonKey(name: 'enable_file_attach') @Default(true) bool enableFileAttach,
/// Server gate for the live AI language switch + manual picker.
// ignore: invalid_annotation_target
@JsonKey(name: 'dynamic_language_enabled')
@Default(false)
bool dynamicLanguageEnabled,
/// Server gate for the in-chat AI disclosure notice.
// ignore: invalid_annotation_target
@JsonKey(name: 'ai_disclosure_enabled')
@Default(true)
bool aiDisclosureEnabled,
/// Per-locale disclosure text (null = SDK default).
// ignore: invalid_annotation_target
@JsonKey(name: 'ai_disclosure_text') LocalizedText? aiDisclosureText,
/// Whether the disclosure requires a one-time acknowledgement.
// ignore: invalid_annotation_target
@JsonKey(name: 'ai_disclosure_require_ack')
@Default(false)
bool aiDisclosureRequireAck,
/// Server gate for the in-chat message report ("Bad response") flow.
// ignore: invalid_annotation_target
@JsonKey(name: 'message_reporting_enabled')
@Default(true)
bool messageReportingEnabled,
/// "Learn more" About-AI link.
// ignore: invalid_annotation_target
@JsonKey(name: 'ai_info_url') String? aiInfoUrl,
/// Privacy page link (fallback "Learn more").
// ignore: invalid_annotation_target
@JsonKey(name: 'privacy_url') String? privacyUrl,
/// Whether to show the data-reuse notice line.
// ignore: invalid_annotation_target
@JsonKey(name: 'ai_data_reuse_notice')
@Default(false)
bool aiDataReuseNotice,
}) = _RemoteConfig;