isLoginBefore method Null safety

Future<bool> isLoginBefore()

Checks whether the user has logged in before and did not log out.

Reference: If you need to check whether the SDK is connected to the server, please use {@link #isConnected()}.

Return The result of whether the user has logged in before. true: means that the user has logged in before, false: means that the user has not login before or has called {@link #logout()} method.

Implementation

Future<bool> isLoginBefore() async {
  Map result = await _channel.invokeMethod(ChatMethodKeys.isLoggedInBefore);
  try {
    EMError.hasErrorFromResult(result);
    return result.boolValue(ChatMethodKeys.isLoggedInBefore);
  } on EMError catch (e) {
    throw e;
  }
}