setConversationSilentMode method Null safety

Future<void> setConversationSilentMode(
  1. {required String conversationId,
  2. required ChatConversationType type,
  3. required ChatSilentModeParam param}
)

Set offline push notification type for the special conversation.

Param conversationId The conversation id.

Param type The conversation type.

Param param Push DND parameters offline.

Throws A description of the exception. See {@link ChatError}.

Implementation

Future<void> setConversationSilentMode({
  required String conversationId,
  required ChatConversationType type,
  required ChatSilentModeParam param,
}) async {
  Map req = {};
  req["conversationId"] = conversationId;
  req["conversationType"] = conversationTypeToInt(type);
  req["param"] = param.toJson();

  Map result = await _channel.invokeMethod(
      ChatMethodKeys.setConversationSilentMode, req);
  try {
    ChatError.hasErrorFromResult(result);
  } on ChatError catch (e) {
    throw e;
  }
}