getAccessToken method Null safety

Future<String> getAccessToken()

Gets the token of the current logged-in user.

Implementation

Future<String> getAccessToken() async {
  Map result = await _channel.invokeMethod(ChatMethodKeys.getToken);
  try {
    EMError.hasErrorFromResult(result);
    return result[ChatMethodKeys.getToken];
  } on EMError catch (e) {
    throw e;
  }
}