acceptInvitation method Null safety

Future<void> acceptInvitation(
  1. String username
)

Accepts a friend invitation。

Param username The user who sends the friend invitation.

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

Implementation

Future<void> acceptInvitation(String username) async {
  Map req = {'username': username};
  Map result =
      await _channel.invokeMethod(ChatMethodKeys.acceptInvitation, req);
  try {
    EMError.hasErrorFromResult(result);
  } on EMError catch (e) {
    throw e;
  }
}