AttachmentFactory

constructor(canHandle: (attachments: List<Attachment>) -> Boolean, previewContent: @Composable (modifier: Modifier, attachments: List<Attachment>, onAttachmentRemoved: (Attachment) -> Unit) -> Unit? = null, content: @Composable (modifier: Modifier, attachmentState: AttachmentState) -> Unit, textFormatter: (attachments: Attachment) -> String = { it.title ?: it.name ?: it.fallback ?: "" }, type: AttachmentFactory.Type = Type.None)

Parameters

canHandle

Checks the message and returns if the factory can consume it or not.

previewContent

Composable function that allows users to define the content the AttachmentFactory will build, using any given AttachmentState, when the message is displayed in the message input preview, before sending.

content

Composable function that allows users to define the content the AttachmentFactory will build using any given AttachmentState, when the message is displayed in the message list.

textFormatter

The formatter used to get a string representation for the given attachment.