MessagesModalOptions class

Configuration for the messages modal enabling direct-message and group-chat workflows.

  • onMessagesClose - Callback when user closes the chat interface.
  • onSendMessagePress - Override for sendMessage; receives {message, sender, receivers, group, socket, islevel}. Return true if send succeeded.
  • messages - Full list of Message objects; modal filters by group, sender, receivers based on eventType and selected tab.
  • position - Modal placement via getModalPosition (e.g., 'topRight').
  • backgroundColor / activeTabBackgroundColor - Theming for modal body and active tab indicator.
  • eventType - Determines tab visibility: EventType.conference/EventType.webinar show both direct/group tabs; EventType.chat/EventType.broadcast show group-only.
  • member / islevel - Current user's name and privilege level ('2' = host, '1' = moderator, '0' = participant).
  • coHostResponsibility - List of CoHostResponsibility objects; if name == 'chat' and value == true, co-host can see all messages.
  • coHost - Co-host username; if member == coHost, grant elevated permissions.
  • startDirectMessage / directMessageDetails - When initiating a DM from ParticipantsModal, set startDirectMessage = true and populate directMessageDetails with target Participant.
  • updateStartDirectMessage / updateDirectMessageDetails - Callbacks to reset DM state after modal opens.
  • roomName - Session identifier for outbound messages.
  • socket - Socket.IO client for real-time sendMessage emissions.
  • chatSetting - Permission string: 'disallow' blocks sends; 'allow' permits all; role-based checks apply otherwise.
  • showAlert - Optional ShowAlert callback for validation/error messages.

Usage

  1. _populateMessages splits messages into directMessages and groupMessages based on sender/receiver logic and eventType.
  2. Tab selection switches between these lists, with direct-message tab hidden for EventType.chat/broadcast.
  3. MessagePanel renders the active list with reply/input affordances.
  4. Override this modal via MediasfuUICustomOverrides.messagesModal to inject custom filtering, message encryption, or alternative send logic.

Constructors

MessagesModalOptions({required bool isMessagesModalVisible, required VoidCallback onMessagesClose, SendMessageType onSendMessagePress = sendMessage, required List<Message> messages, String position = 'topRight', Color backgroundColor = const Color(0xFFF5F5F5), Color activeTabBackgroundColor = const Color.fromARGB(255, 150, 231, 236), required EventType eventType, required String member, required String islevel, required List<CoHostResponsibility> coHostResponsibility, required String coHost, required bool startDirectMessage, Participant? directMessageDetails, required dynamic updateStartDirectMessage(bool), required dynamic updateDirectMessageDetails(Participant?), required String roomName, Socket? socket, required String chatSetting, ShowAlert? showAlert})

Properties

activeTabBackgroundColor Color
final
backgroundColor Color
final
chatSetting String
final
coHost String
final
coHostResponsibility List<CoHostResponsibility>
final
directMessageDetails Participant?
final
eventType EventType
final
hashCode int
The hash code for this object.
no setterinherited
islevel String
final
isMessagesModalVisible bool
final
member String
final
messages List<Message>
final
onMessagesClose VoidCallback
final
onSendMessagePress SendMessageType
final
position String
final
roomName String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showAlert ShowAlert?
final
socket → Socket?
final
startDirectMessage bool
final
updateDirectMessageDetails → dynamic Function(Participant?)
final
updateStartDirectMessage → dynamic Function(bool)
final

Methods

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