HostSlotBuilder typedef

HostSlotBuilder = Widget? Function(String slotId, Map<String, dynamic>? payload)

Builder the host registers to render a host_slot component with its own native widget. The SDK calls it with the slot's slotId and payload (carried in the message JSON); return the widget to inline in the bubble.

Must be a pure function of its inputs — chat history reloads re-parse the JSON, so the widget has to be reconstructable from payload alone. Return null (or a zero-size widget) for slot ids the host doesn't recognise.

Implementation

typedef HostSlotBuilder =
    Widget? Function(String slotId, Map<String, dynamic>? payload);