BotConfiguration class abstract

Configuration for the chatbot widget behavior and appearance.

Contains all settings needed to customize the chatbot's functionality, styling, and initial state.

Example:

final config = BotConfiguration(
  userID: 'user123',
  projectSecretKey: 'your-secret-key',
  name: 'Support Bot',
  welcomeMessage: 'Hello! How can I help you?',
);
Available extensions
Annotations
  • @freezed

Constructors

BotConfiguration({required String userID, required String projectSecretKey, String? welcomeMessage, String? allowedOrigins, String? name, @Default.new('Roboto') String? fontFamily, @Default.new('#3B82F6') String? color, @unfreezed Uint8List? avatar, String? systemInstructions, @Default.new(false) bool isPreviewMode, @Default.new(FabConfiguration()) FabConfiguration fabConfiguration})
const
factory

Properties

allowedOrigins String?
Comma-separated list of allowed origins for CORS.
no setterinherited
avatar Uint8List?
Avatar image data. Note: This is excluded from JSON serialization.
no setterinherited
color String?
Primary color for the chat interface in hex format.
no setterinherited
copyWith → $BotConfigurationCopyWith<BotConfiguration>
Create a copy of BotConfiguration with the given fields replaced by the non-null parameter values.
no setterinherited
fabConfiguration FabConfiguration
Configuration for the floating action button appearance.
no setterinherited
fontFamily String?
Font family for chat text. Defaults to 'Roboto'.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isPreviewMode bool
Whether the bot is running in preview mode.
no setterinherited
name String?
Display name for the chatbot.
no setterinherited
projectSecretKey String
Secret key for authenticating with the bot service. Keep this secure and never expose in logs.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
systemInstructions String?
System instructions that guide the bot's behavior.
no setterinherited
userID String
Unique identifier for the user interacting with the bot.
no setterinherited
welcomeMessage String?
Initial message displayed when the chat opens.
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_BotConfiguration value)) → TResult

Available on BotConfiguration, provided by the BotConfigurationPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_BotConfiguration value)?) → TResult?

Available on BotConfiguration, provided by the BotConfigurationPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_BotConfiguration value)?, {required TResult orElse()}) → TResult

Available on BotConfiguration, provided by the BotConfigurationPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(String userID, String projectSecretKey, String? welcomeMessage, String? allowedOrigins, String? name, String? fontFamily, String? color, Uint8List? avatar, String? systemInstructions, bool isPreviewMode, FabConfiguration fabConfiguration)?, {required TResult orElse()}) → TResult

Available on BotConfiguration, provided by the BotConfigurationPatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(String userID, String projectSecretKey, String? welcomeMessage, String? allowedOrigins, String? name, String? fontFamily, String? color, Uint8List? avatar, String? systemInstructions, bool isPreviewMode, FabConfiguration fabConfiguration)) → TResult

Available on BotConfiguration, provided by the BotConfigurationPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(String userID, String projectSecretKey, String? welcomeMessage, String? allowedOrigins, String? name, String? fontFamily, String? color, Uint8List? avatar, String? systemInstructions, bool isPreviewMode, FabConfiguration fabConfiguration)?) → TResult?

Available on BotConfiguration, provided by the BotConfigurationPatterns extension

A variant of when that fallback to returning null

Operators

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