RequestsModalOptions class
Configuration for the requests modal displaying participant requests (screenshare/video/audio).
- requestList - Array of
Request
objects; 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}.action
is'accepted'
(grant) or'rejected'
(deny); emitsupdateRequestAction
socket event. - onRequestFilterChange - Callback when search input changes; filters
requestList
by participant name. - updateRequestList - Updates
requestList
in parent state after grant/deny. - roomName - Session identifier for socket event.
- socket - Socket.IO client for emitting
updateRequestAction
event. - position - Modal placement via
getModalPosition
(e.g., 'topRight'). - backgroundColor - Background color for modal container.
- renderRequestComponent - Custom renderer for individual request items; receives
RenderRequestComponentOptions
withrequest
,onRequestItemPress
,requestList
,updateRequestList
,roomName
,socket
. Defaults toRenderRequestComponent
widget. - parameters - Must expose
getUpdatedAllParams
.
Usage
- Modal displays header with "Requests" title and counter badge.
- Search input filters
requestList
by participant name. - Each request row shows name, icon (microphone/video/screenshare), and "Accept" (green) / "Reject" (red) buttons.
- "Accept" button calls
onRequestItemPress
withaction: 'accepted'
, emittingupdateRequestAction
socket event with{requestId, action: 'accepted', roomName}
. - "Reject" button calls
onRequestItemPress
withaction: 'rejected'
, emittingupdateRequestAction
event withaction: 'rejected'
. - After grant/deny,
updateRequestList
removes request from queue. - Override via
MediasfuUICustomOverrides.requestsModal
to 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