create static method

User create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "user",
  3. String? id,
  4. String? first_name,
  5. String? type,
})
override

Generated

Implementation

static User create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "user",
  String? id,
  String? first_name,
  String? type,
}) {
  // User user = User({
  final Map user_data_create_json = {
    "@type": special_type,
    "id": id,
    "first_name": first_name,
    "type": type,
  };

  user_data_create_json.removeWhere((key, value) => value == null);

  if (schemeUtilsIsSetDefaultData) {
    defaultData.forEach((key, value) {
      if (user_data_create_json.containsKey(key) == false) {
        user_data_create_json[key] = value;
      }
    });
  }
  return User(user_data_create_json);
}