FindChatWidget class

Punto de entrada del SDK. Ejemplo mínimo:

FindChatWidget(
  connectionId: 'e2ewebchattest0000000000000000ab',
  baseUrl: 'https://api.tuapp.com',
  theme: FindChatTheme.light,
  mode: FindChatMode.floating,
)

Sin controller explícito, crea uno propio y lo inicializa/dispone automáticamente. Para control programático desde fuera del widget tree (abrir el chat desde un botón en otra pantalla, por ejemplo), instanciá y pasá tu propio FindChatController:

final controller = FindChatController(connectionId: '...', baseUrl: '...');
// ...
FindChatWidget(connectionId: '...', controller: controller)
// en cualquier otro widget:
controller.open();

mode/theme/visualStyle en null usan lo configurado en la conexión (display_mode/color_scheme/visual_style, ver docs/webchat-widget-api.md en el repo del backend) — mismo orden de precedencia que el widget web: override explícito acá > config remota > default de fábrica.

FindChatMode.floating y FindChatMode.drawer se insertan vía Overlay (flotan sobre toda la app, no solo sobre este widget) — necesitan un Navigator/Overlay ancestro, presente automáticamente bajo MaterialApp/WidgetsApp.

Inheritance

Constructors

FindChatWidget({Key? key, required String connectionId, String? baseUrl, FindChatTheme? theme, FindChatMode? mode, FindChatVisualStyle? visualStyle, FindChatThemeBuilder? themeBuilder, bool showHeader = true, Color? userBubbleColor, Color? assistantBubbleColor, Color? userBubbleTextColor, Color? assistantBubbleTextColor, double? inputHeight, FindChatActionsBuilder? actionsBuilder, FindChatController? controller, String? externalVisitorId, String? originOverride, FindChatTokenProvider? tokenProvider, Map<String, dynamic>? options})
const

Properties

actionsBuilder FindChatActionsBuilder?
Compone el menú flotante que abre un long press sobre el botón de enviar. Recibe las acciones que trae el SDK — hoy solo "Eliminar conversación", ya resuelta contra el estado actual — y devuelve la lista final, así que sirve tanto para agregar acciones propias como para quitar o reordenar las default:
final
assistantBubbleColor Color?
final
assistantBubbleTextColor Color?
final
baseUrl String?
Si es null, usa FindChatEnvironment.baseUrl (ver find_chat_environment.dart).
final
connectionId String
final
controller FindChatController?
Si se pasa, este widget NO crea ni dispone su propio controller — lo gestiona quien lo haya creado. Útil para controlar el chat desde fuera.
final
externalVisitorId String?
final
hashCode int
The hash code for this object.
no setterinherited
inputHeight double?
Fixed height for the bottom text field. Null keeps automatic height.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
mode FindChatMode?
final
options Map<String, dynamic>?
Opciones que acotan el alcance de cada turno (ver FindChatController.options). Las arma el backend de la app y viajan tal cual; el SDK no interpreta su contenido.
final
originOverride String?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showHeader bool
Muestra/oculta el header interno del panel (título, avatar, botón de nueva conversación y cierre). Default: true.
final
theme FindChatTheme?
final
themeBuilder FindChatThemeBuilder?
Permite ajustar el ThemeData interno ya resuelto por el SDK.
final
tokenProvider FindChatTokenProvider?
Para conexiones auth_mode: "signed": callback que devuelve el JWT de visitante emitido por el backend de la app (ver FindChatTokenProvider). Requiere pasar también externalVisitorId con el mismo visitor_id del claim del token.
final
userBubbleColor Color?
Fine-grained message bubble color overrides.
final
userBubbleTextColor Color?
final
visualStyle FindChatVisualStyle?
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<FindChatWidget>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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