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 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 logout method.

Implementation

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