create static method

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

Generated

Implementation

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

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

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