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}. Returntrueif send succeeded. - messages - Full list of
Messageobjects; modal filters bygroup,sender,receiversbased oneventTypeand 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.webinarshow both direct/group tabs;EventType.chat/EventType.broadcastshow group-only. - member / islevel - Current user's name and privilege level (
'2'= host,'1'= moderator,'0'= participant). - coHostResponsibility - List of
CoHostResponsibilityobjects; ifname == 'chat'andvalue == 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 = trueand populatedirectMessageDetailswith targetParticipant. - updateStartDirectMessage / updateDirectMessageDetails - Callbacks to reset DM state after modal opens.
- roomName - Session identifier for outbound messages.
- socket - Socket.IO client for real-time
sendMessageemissions. - chatSetting - Permission string:
'disallow'blocks sends;'allow'permits all; role-based checks apply otherwise. - showAlert - Optional
ShowAlertcallback for validation/error messages.
Usage
_populateMessagessplitsmessagesintodirectMessagesandgroupMessagesbased on sender/receiver logic andeventType.- Tab selection switches between these lists, with direct-message tab hidden for
EventType.chat/broadcast. MessagePanelrenders the active list with reply/input affordances.- Override this modal via
MediasfuUICustomOverrides.messagesModalto 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