createUser method

Future<QBUser?> createUser(
  1. String login,
  2. String password, {
  3. String? email,
  4. int? blobId,
  5. int? externalUserId,
  6. int? facebookId,
  7. int? twitterId,
  8. String? fullName,
  9. String? phone,
  10. String? website,
  11. String? customData,
  12. List<String>? tags,
})

Implementation

Future<QBUser?> createUser(String login, String password,
    {String? email,
    int? blobId,
    int? externalUserId,
    int? facebookId,
    int? twitterId,
    String? fullName,
    String? phone,
    String? website,
    String? customData,
    List<String>? tags}) async {
  Map<String, Object> data = Map();

  data["login"] = login;
  data["password"] = password;

  if (email != null) {
    data["email"] = email;
  }
  if (blobId != null) {
    data["blobId"] = blobId;
  }
  if (externalUserId != null) {
    data["externalUserId"] = externalUserId;
  }
  if (facebookId != null) {
    data["facebookId"] = facebookId;
  }
  if (twitterId != null) {
    data["twitterId"] = twitterId;
  }
  if (fullName != null) {
    data["fullName"] = fullName;
  }
  if (phone != null) {
    data["phone"] = phone;
  }
  if (website != null) {
    data["website"] = website;
  }
  if (customData != null) {
    data["customData"] = customData;
  }
  if (tags != null) {
    data["tags"] = tags;
  }

  Map<Object?, Object?> map = await _usersModule.invokeMethod(CREATE_METHOD, data);

  QBUser? qbUser = QBUserMapper.mapToQBUser(map);

  return qbUser;
}