mapFromJson static method

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

Implementation

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

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

    return previousValue;
  });
}