onMessageLongPressed property

OnMessageGesture? onMessageLongPressed
final

The callback when the user presses down a message for long.

By default, the message is selected.

Example of how to intercept the default gesture event on message.

Calling the second argument defaultAction implements the default action together with your custom action. Sample code below

ChatFlow(
  messages: messages,
  chatUser: chatUsers,
  onSendPressed: onSendPressed,
  onAttachmentPressed: _handleImageSelection,
  onMessageLongPressed: (Message message, Function(Message message) defaultAction) {
    defaultAction(message);
  },
  onMessageSelectionChanged: _handleMessageSelectionChange,
),

In the example we executed a custom code before calling the default action which is to select the message.

Feel free to use it as you want! Callback for message long pressed

Implementation

/// Callback for message long pressed
final OnMessageGesture? onMessageLongPressed;