FindChatAction class
Una acción del menú flotante del chat (long press sobre el botón de
enviar). El SDK trae una sola por default — "Eliminar conversación" — y la
app host puede agregar, quitar o reordenar con
FindChatWidget(actionsBuilder: ...).
FindChatWidget(
connectionId: '...',
actionsBuilder: (context, defaults) => [
...defaults,
FindChatAction(
id: 'contact_support',
label: 'Hablar con un humano',
icon: Icons.support_agent_rounded,
onInvoke: () => abrirTicket(),
),
],
)
- Annotations
Constructors
-
FindChatAction({required String id, required String label, required FutureOr<
void> onInvoke(), IconData? icon, bool enabled = true, bool isDestructive = false, FindChatActionConfirmation? confirmation}) -
const
Properties
- confirmation → FindChatActionConfirmation?
-
Null ⇒ onInvoke se ejecuta directo al tocar el item.
final
- enabled → bool
-
En false el item se muestra atenuado y no responde. El SDK lo usa para
deshabilitar el borrado mientras hay un turno en curso.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData?
-
final
- id → String
-
Identificador estable — le sirve al host para ubicar y reemplazar una
acción default dentro de FindChatActionsBuilder sin depender del orden.
La acción de borrado que trae el SDK usa
'clear_conversation'.final - isDestructive → bool
-
Pinta el item con el color de error del theme. Solo estética — el paso de
confirmación se controla con confirmation.
final
- label → String
-
final
-
onInvoke
→ FutureOr<
void> Function() -
Se ejecuta al elegir la acción (y después de confirmar, si hay
confirmation). Puede ser async: el menú se cierra antes de invocarla.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{String? label, IconData? icon, bool? enabled, bool? isDestructive, FindChatActionConfirmation? confirmation, FutureOr< void> onInvoke()?}) → FindChatAction -
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