addReaction method Null safety

Future<void> addReaction(
  1. {required String messageId,
  2. required String reaction}
)

/ Reaction

Adds a reaction.

Param messageId The message ID.

Param reaction The reaction content.

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

Implementation

///
/// Adds a reaction.
///
/// Param [messageId] The message ID.
///
/// Param [reaction] The reaction content.
///
/// **Throws**  A description of the exception. See {@link ChatError}.
///
Future<void> addReaction({
  required String messageId,
  required String reaction,
}) async {
  Map req = {"reaction": reaction, "msgId": messageId};
  Map result = await ChatMethodChannel.ChatManager.invokeMethod(
      ChatMethodKeys.addReaction, req);
  try {
    ChatError.hasErrorFromResult(result);
  } on ChatError catch (e) {
    throw e;
  }
}