createUser method

Future<Either<ApiError, void>> createUser(
  1. String username,
  2. String email,
  3. String password
)

Implementation

Future<Either<ApiError, void>> createUser(
    String username, String email, String password) {
  if (username.isEmpty || email.isEmpty || password.isEmpty) {
    throw Exception(
        "One or more of the field (username, email, password) is empty");
  }
  return post<void>("$_authRoutesPrefix/sign-up", (json) {}, requestBody: {
    "username": username,
    "email": email,
    "password": password
  });
}