fetchConversationSilentMode method Null safety

Future<ChatSilentModeResult> fetchConversationSilentMode(
  1. {required String conversationId,
  2. required ChatConversationType type}
)

Gets the DND setting of the special conversation.

Param conversationId The conversation id.

Param type The conversation type.

Return The conversation silent mode.

Throws A description of the exception. See ChatError.

Implementation

Future<ChatSilentModeResult> fetchConversationSilentMode({
  required String conversationId,
  required ChatConversationType type,
}) async {
  Map req = {};
  req["conversationId"] = conversationId;
  req["conversationType"] = conversationTypeToInt(type);
  Map result = await PushChannel.invokeMethod(
      ChatMethodKeys.fetchConversationSilentMode, req);
  try {
    ChatError.hasErrorFromResult(result);
    Map map = result[ChatMethodKeys.fetchConversationSilentMode];
    return ChatSilentModeResult.fromJson(map);
  } on ChatError catch (e) {
    throw e;
  }
}