createUser static method

Future<User> createUser({
  1. UserProfile? profile,
  2. UserIdentifier? identifier,
  3. String? password,
})

Implementation

static Future<User> createUser({
  UserProfile? profile,
  UserIdentifier? identifier,
  String? password,
}) async {
  HeraRequest req = HeraRequest()..namespace = _namespace;
  User user = userWithIdentifiers(identifier);
  user.profile = profile ?? UserProfile();
  user.password = Hash(body: password ?? "");
  req.user = user;
  try {
    HeraResponse resp = await _heraClient.create(req);
    return resp.user;
  } catch (e) {
    if (_debug == true) {
      print("could not create user with err: " + e.toString());
    }
    rethrow;
  }
}