class BotsModel { int? id; String? name; String? image; String? responseType; String? description; String? short; List? attachmentType; int? attachment; bool? editable; BotsModel( {this.id, this.name, this.image, this.attachment, this.attachmentType, this.description, this.editable, this.responseType}); BotsModel.fromJson(Map json) { id = json['id']; name = json['name']; image = json['image']; description = json['description']; short = json['short']; if (json['attachmentType'] != null) { attachmentType = []; json['attachmentType'].forEach((v) { attachmentType!.add(v); }); } attachment = json['attachment']; editable = json['editable']; responseType = json['responseType']; } Map toJson() { final Map data = {}; data['id'] = id; data['name'] = name; data['image'] = image; data['description'] = description; data['short'] = short; if (attachmentType != null) { data['attachmentType'] = attachmentType!.map((v) => v).toList(); } data['attachment'] = attachment; data['editable'] = editable; data['responseType'] = responseType; return data; } BotsModel copyWith( {int? id, String? name, String? image, String? responseType, String? description, List? attachmentType, int? attachment, bool? editable}) { return BotsModel( id: id ?? this.id, name: name ?? this.name, image: image ?? this.image, responseType: responseType ?? this.responseType, description: description ?? this.description, attachmentType: attachmentType ?? this.attachmentType, attachment: attachment ?? this.attachment, editable: editable ?? this.editable, ); } }