userExists method

Future<bool> userExists(
  1. String email
)

Checks if a user with the given email exists.

Makes a GET /user/exists?email= request.

email is the email address to check.

Returns true if the user exists, false otherwise.

Throws DioError on failure.

Implementation

Future<bool> userExists(String email) async {
  try {
    final response = await client.dio.get(ApiEndpoints.userExists(email));
    // The API typically returns the user object if exists, or null/error if not
    return response.data != null;
  } catch (e) {
    // If we get a 404 or similar, user doesn't exist
    return false;
  }
}