create static method
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,
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);
}