mapFromJson static method

Map<String, DocumentPatchFile> mapFromJson(
  1. Map<String, dynamic>? json
)

Implementation

static Map<String, DocumentPatchFile> mapFromJson(
    Map<String, dynamic>? json) {
  if (json == null) {
    return <String, DocumentPatchFile>{};
  }

  return json.entries.fold(<String, DocumentPatchFile>{},
      (Map<String, DocumentPatchFile> previousValue, element) {
    final DocumentPatchFile? object =
        DocumentPatchFile.fromJson(element.value);
    if (object is DocumentPatchFile) {
      previousValue[element.key] = object;
    }

    return previousValue;
  });
}