create static method

Document create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "document",
  3. String? url,
  4. String? mimetype,
  5. String? title,
  6. String? filesha256,
  7. String? filelength,
  8. num? pagecount,
  9. String? mediakey,
  10. String? filename,
  11. String? fileencsha256,
  12. String? directpath,
  13. String? mediakeytimestamp,
  14. ContextInfo? contextinfo,
})
override

Generated

Implementation

static Document create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "document",
  String? url,
  String? mimetype,
  String? title,
  String? filesha256,
  String? filelength,
  num? pagecount,
  String? mediakey,
  String? filename,
  String? fileencsha256,
  String? directpath,
  String? mediakeytimestamp,
  ContextInfo? contextinfo,
}) {
  // Document document = Document({
  final Map document_data_create_json = {
    "@type": special_type,
    "url": url,
    "mimetype": mimetype,
    "title": title,
    "fileSha256": filesha256,
    "fileLength": filelength,
    "pageCount": pagecount,
    "mediaKey": mediakey,
    "fileName": filename,
    "fileEncSha256": fileencsha256,
    "directPath": directpath,
    "mediaKeyTimestamp": mediakeytimestamp,
    "contextInfo": (contextinfo != null) ? contextinfo.toJson() : null,
  };

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

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