reportMessage method Null safety
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 ChatError.
Implementation
Future<void> reportMessage({
required String messageId,
required String tag,
required String reason,
}) async {
Map req = {"msgId": messageId, "tag": tag, "reason": reason};
Map result =
await ChatChannel.invokeMethod(ChatMethodKeys.reportMessage, req);
try {
ChatError.hasErrorFromResult(result);
} on ChatError catch (e) {
throw e;
}
}