RemoteConfig class abstract
Remote configuration fetched from the server.
Represents the bot configuration as stored on the server, which may have different field names than the local configuration.
- Available extensions
- Annotations
-
- @freezed
Constructors
-
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}) -
constfactory
-
RemoteConfig.fromJson(Map<
String, Object?> json) -
factory
Properties
- aiDataReuseNotice → bool
-
Whether to show the data-reuse notice line.
no setterinherited
- aiDisclosureEnabled → bool
-
Server gate for the in-chat AI disclosure notice.
no setterinherited
- aiDisclosureRequireAck → bool
-
Whether the disclosure requires a one-time acknowledgement.
no setterinherited
- aiDisclosureText → LocalizedText?
-
Per-locale disclosure text (null = SDK default).
no setterinherited
- aiInfoUrl → String?
-
"Learn more" About-AI link.
no setterinherited
- avatar → String?
-
Avatar URL or data from server.
no setterinherited
- chatAppearance → ChatAppearance?
-
Chat-surface appearance from server. When present, fields
override the SDK's MD3 defaults; when null/missing, the SDK
uses the ambient ColorScheme.
no setterinherited
- chatAppearanceDark → ChatAppearance?
-
Dark-mode chat-surface appearance. Picked when the active theme
brightness is dark; null/missing → the SDK's MD3 dark defaults.
no setterinherited
- color → String?
-
Primary color setting from server.
no setterinherited
-
copyWith
→ $RemoteConfigCopyWith<
RemoteConfig> -
Create a copy of RemoteConfig
with the given fields replaced by the non-null parameter values.
no setterinherited
- defaultLocale → String
-
Default locale from server
no setterinherited
- defaultThemeMode → String
-
Initial theme mode before the user overrides it locally — one of
'light', 'dark', or 'system' (follows the host device brightness).
no setterinherited
- dynamicLanguageEnabled → bool
-
Server gate for the live AI language switch + manual picker.
no setterinherited
- enableClearHistory → bool
-
Server-side gate for the in-chat "Clear chat history" menu item.
no setterinherited
- enableFileAttach → bool
-
Server-side gate for the paperclip attach button in chat input.
no setterinherited
- enableUserExport → bool
-
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.
no setterinherited
- fabConfiguration → FabConfiguration?
-
FAB configuration from server.
no setterinherited
- fontFamily → String?
-
Font family setting from server. The backend emits snake_case
font_family; without this JSONKey the generated parser would readfontFamilyand always get null, silently falling back to 'Roboto' no matter what font the tenant configured.no setterinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- messageReportingEnabled → bool
-
Server gate for the in-chat message report ("Bad response") flow.
no setterinherited
- name → LocalizedText
-
Bot display name from server (localized).
no setterinherited
- privacyUrl → String?
-
Privacy page link (fallback "Learn more").
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showThemeToggle → bool
-
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.
no setterinherited
- soundConfiguration → SoundConfiguration?
-
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.
no setterinherited
-
supportedLocales
→ List<
String> -
Supported locales from server
no setterinherited
- systemInstruction → LocalizedText
-
System instructions from server (localized).
no setterinherited
- welcomeMessage → LocalizedText
-
Welcome message from server configuration (localized).
no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_RemoteConfig value)) → TResult -
Available on RemoteConfig, provided by the RemoteConfigPatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_RemoteConfig value)?) → TResult? -
Available on RemoteConfig, provided by the RemoteConfigPatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> (TResult $default(_RemoteConfig value)?, {required TResult orElse()}) → TResult -
Available on RemoteConfig, provided by the RemoteConfigPatterns extension
A variant ofmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> (TResult $default(LocalizedText name, LocalizedText welcomeMessage, LocalizedText systemInstruction, String defaultLocale, List< String> supportedLocales, String? fontFamily, String? color, String? avatar, FabConfiguration? fabConfiguration, ChatAppearance? chatAppearance, ChatAppearance? chatAppearanceDark, bool showThemeToggle, String defaultThemeMode, SoundConfiguration? soundConfiguration, bool enableUserExport, bool enableClearHistory, bool enableFileAttach, bool dynamicLanguageEnabled, bool aiDisclosureEnabled, LocalizedText? aiDisclosureText, bool aiDisclosureRequireAck, bool messageReportingEnabled, String? aiInfoUrl, String? privacyUrl, bool aiDataReuseNotice)?, {required TResult orElse()}) → TResult -
Available on RemoteConfig, provided by the RemoteConfigPatterns extension
A variant ofwhenthat fallback to anorElsecallback. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toBotConfiguration(
{required String userID, required String projectSecretKey, Uint8List? avatar, String? currentLocale, String? userIdSignature, bool isPreviewMode = false, Map< String, dynamic> ? userContext, String? authToken}) → BotConfiguration -
Available on RemoteConfig, provided by the RemoteConfigMapping extension
-
toJson(
) → Map< String, dynamic> -
Serializes this RemoteConfig to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> (TResult $default(LocalizedText name, LocalizedText welcomeMessage, LocalizedText systemInstruction, String defaultLocale, List< String> supportedLocales, String? fontFamily, String? color, String? avatar, FabConfiguration? fabConfiguration, ChatAppearance? chatAppearance, ChatAppearance? chatAppearanceDark, bool showThemeToggle, String defaultThemeMode, SoundConfiguration? soundConfiguration, bool enableUserExport, bool enableClearHistory, bool enableFileAttach, bool dynamicLanguageEnabled, bool aiDisclosureEnabled, LocalizedText? aiDisclosureText, bool aiDisclosureRequireAck, bool messageReportingEnabled, String? aiInfoUrl, String? privacyUrl, bool aiDataReuseNotice)) → TResult -
Available on RemoteConfig, provided by the RemoteConfigPatterns extension
Aswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(LocalizedText name, LocalizedText welcomeMessage, LocalizedText systemInstruction, String defaultLocale, List< String> supportedLocales, String? fontFamily, String? color, String? avatar, FabConfiguration? fabConfiguration, ChatAppearance? chatAppearance, ChatAppearance? chatAppearanceDark, bool showThemeToggle, String defaultThemeMode, SoundConfiguration? soundConfiguration, bool enableUserExport, bool enableClearHistory, bool enableFileAttach, bool dynamicLanguageEnabled, bool aiDisclosureEnabled, LocalizedText? aiDisclosureText, bool aiDisclosureRequireAck, bool messageReportingEnabled, String? aiInfoUrl, String? privacyUrl, bool aiDataReuseNotice)?) → TResult? -
Available on RemoteConfig, provided by the RemoteConfigPatterns extension
A variant ofwhenthat fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited