reportMessage method Null safety
// Moderation
Report violation message
Param messageId Violation Message ID
Param tag The report type (For example: involving pornography and terrorism).
Param reason The reason for reporting.
Throws A description of the exception. See {@link ChatError}.
Implementation
///
/// Report violation message
///
/// Param [messageId] Violation Message ID
///
/// Param [tag] The report type (For example: involving pornography and terrorism).
///
/// Param [reason] The reason for reporting.
///
/// **Throws** A description of the exception. See {@link ChatError}.
///
Future<void> reportMessage({
required String messageId,
required String tag,
required String reason,
}) async {
Map req = {"msgId": messageId, "tag": tag, "reason": reason};
Map result = await ChatMethodChannel.ChatManager.invokeMethod(
ChatMethodKeys.reportMessage, req);
try {
ChatError.hasErrorFromResult(result);
} on ChatError catch (e) {
throw e;
}
}