mapFromJson static method

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

Implementation

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

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

    return previousValue;
  });
}