RequestsModalOptions class
Configuration for the requests modal displaying participant requests (screenshare/video/audio).
- requestList - Array of
Requestobjects; each hasid,name,icon(FontAwesome icon name like 'fa-microphone', 'fa-video', 'fa-desktop'). - requestCounter - Count of pending requests; shown in modal header badge.
- onRequestItemPress - Override for
respondToRequests; receives {request, updateRequestList, requestList, action, roomName, socket}.actionis'accepted'(grant) or'rejected'(deny); emitsupdateRequestActionsocket event. - onRequestFilterChange - Callback when search input changes; filters
requestListby participant name. - updateRequestList - Updates
requestListin parent state after grant/deny. - roomName - Session identifier for socket event.
- socket - Socket.IO client for emitting
updateRequestActionevent. - position - Modal placement via
getModalPosition(e.g., 'topRight'). - backgroundColor - Background color for modal container.
- renderRequestComponent - Custom renderer for individual request items; receives
RenderRequestComponentOptionswithrequest,onRequestItemPress,requestList,updateRequestList,roomName,socket. Defaults toRenderRequestComponentwidget. - parameters - Must expose
getUpdatedAllParams.
Usage
- Modal displays header with "Requests" title and counter badge.
- Search input filters
requestListby participant name. - Each request row shows name, icon (microphone/video/screenshare), and "Accept" (green) / "Reject" (red) buttons.
- "Accept" button calls
onRequestItemPresswithaction: 'accepted', emittingupdateRequestActionsocket event with{requestId, action: 'accepted', roomName}. - "Reject" button calls
onRequestItemPresswithaction: 'rejected', emittingupdateRequestActionevent withaction: 'rejected'. - After grant/deny,
updateRequestListremoves request from queue. - Override via
MediasfuUICustomOverrides.requestsModalto inject custom approval workflows, analytics tracking, or automated policies.
Constructors
-
RequestsModalOptions.new({required bool isRequestsModalVisible, required VoidCallback onRequestClose, required int requestCounter, required dynamic onRequestFilterChange(String), required List<
Request> requestList, RespondToRequestsType onRequestItemPress = respondToRequests, required dynamic updateRequestList(List<Request> ), required String roomName, Socket? socket, Color backgroundColor = const Color(0xFF83C0E9), String position = 'topRight', required RequestsModalParameters parameters, RenderRequestComponentType renderRequestComponent = _defaultRenderRequestComponent})
Properties
- backgroundColor → Color
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isRequestsModalVisible → bool
-
final
- onRequestClose → VoidCallback
-
final
- onRequestFilterChange → dynamic Function(String)
-
final
- onRequestItemPress ↔ RespondToRequestsType
-
getter/setter pair
- parameters → RequestsModalParameters
-
final
- position → String
-
final
- renderRequestComponent ↔ RenderRequestComponentType
-
getter/setter pair
- requestCounter → int
-
final
-
requestList
→ List<
Request> -
final
- roomName → String
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- socket → Socket?
-
final
-
updateRequestList
→ dynamic Function(List<
Request> ) -
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