ShowAlert typedef

ShowAlert = void Function({required int duration, required String message, required String type})

Modifies the settings based on the provided parameters.

The parameters map should contain the following keys:

  • 'showAlert': A function to show an alert message.
  • 'roomName': The name of the room.
  • 'audioSet': The audio setting.
  • 'videoSet': The video setting.
  • 'screenshareSet': The screenshare setting.
  • 'chatSet': The chat setting.
  • 'socket': The socket for communication.

The showAlert function is used to display an alert message with the specified message, type, and duration.

The updateAudioSetting, updateVideoSetting, updateScreenshareSetting, updateChatSetting, and updateIsSettingsModalVisible functions are used to update the corresponding settings and visibility of the settings modal.

If the roomName starts with the letter 'd', none of the settings should be set to 'approval'.

The updateAudioSetting, updateVideoSetting, updateScreenshareSetting, and updateChatSetting functions are called to update the state variables based on the provided logic.

The settings list is created with the provided audio, video, screenshare, and chat settings.

The 'updateSettingsForRequests' event is emitted to the socket with the updated settings and room name.

Finally, the updateIsSettingsModalVisible function is called to close the settings modal.

Implementation

typedef ShowAlert = void Function({
  required String message,
  required String type,
  required int duration,
});