Document.fromJson constructor

Document.fromJson(
  1. Map json_
)

Implementation

Document.fromJson(core.Map json_)
    : this(
        body: json_.containsKey('body')
            ? Body.fromJson(
                json_['body'] as core.Map<core.String, core.dynamic>)
            : null,
        documentId: json_.containsKey('documentId')
            ? json_['documentId'] as core.String
            : null,
        documentStyle: json_.containsKey('documentStyle')
            ? DocumentStyle.fromJson(
                json_['documentStyle'] as core.Map<core.String, core.dynamic>)
            : null,
        footers: json_.containsKey('footers')
            ? (json_['footers'] as core.Map<core.String, core.dynamic>).map(
                (key, value) => core.MapEntry(
                  key,
                  Footer.fromJson(
                      value as core.Map<core.String, core.dynamic>),
                ),
              )
            : null,
        footnotes: json_.containsKey('footnotes')
            ? (json_['footnotes'] as core.Map<core.String, core.dynamic>).map(
                (key, value) => core.MapEntry(
                  key,
                  Footnote.fromJson(
                      value as core.Map<core.String, core.dynamic>),
                ),
              )
            : null,
        headers: json_.containsKey('headers')
            ? (json_['headers'] as core.Map<core.String, core.dynamic>).map(
                (key, value) => core.MapEntry(
                  key,
                  Header.fromJson(
                      value as core.Map<core.String, core.dynamic>),
                ),
              )
            : null,
        inlineObjects: json_.containsKey('inlineObjects')
            ? (json_['inlineObjects'] as core.Map<core.String, core.dynamic>)
                .map(
                (key, value) => core.MapEntry(
                  key,
                  InlineObject.fromJson(
                      value as core.Map<core.String, core.dynamic>),
                ),
              )
            : null,
        lists: json_.containsKey('lists')
            ? (json_['lists'] as core.Map<core.String, core.dynamic>).map(
                (key, value) => core.MapEntry(
                  key,
                  List.fromJson(value as core.Map<core.String, core.dynamic>),
                ),
              )
            : null,
        namedRanges: json_.containsKey('namedRanges')
            ? (json_['namedRanges'] as core.Map<core.String, core.dynamic>)
                .map(
                (key, value) => core.MapEntry(
                  key,
                  NamedRanges.fromJson(
                      value as core.Map<core.String, core.dynamic>),
                ),
              )
            : null,
        namedStyles: json_.containsKey('namedStyles')
            ? NamedStyles.fromJson(
                json_['namedStyles'] as core.Map<core.String, core.dynamic>)
            : null,
        positionedObjects: json_.containsKey('positionedObjects')
            ? (json_['positionedObjects']
                    as core.Map<core.String, core.dynamic>)
                .map(
                (key, value) => core.MapEntry(
                  key,
                  PositionedObject.fromJson(
                      value as core.Map<core.String, core.dynamic>),
                ),
              )
            : null,
        revisionId: json_.containsKey('revisionId')
            ? json_['revisionId'] as core.String
            : null,
        suggestedDocumentStyleChanges:
            json_.containsKey('suggestedDocumentStyleChanges')
                ? (json_['suggestedDocumentStyleChanges']
                        as core.Map<core.String, core.dynamic>)
                    .map(
                    (key, value) => core.MapEntry(
                      key,
                      SuggestedDocumentStyle.fromJson(
                          value as core.Map<core.String, core.dynamic>),
                    ),
                  )
                : null,
        suggestedNamedStylesChanges:
            json_.containsKey('suggestedNamedStylesChanges')
                ? (json_['suggestedNamedStylesChanges']
                        as core.Map<core.String, core.dynamic>)
                    .map(
                    (key, value) => core.MapEntry(
                      key,
                      SuggestedNamedStyles.fromJson(
                          value as core.Map<core.String, core.dynamic>),
                    ),
                  )
                : null,
        suggestionsViewMode: json_.containsKey('suggestionsViewMode')
            ? json_['suggestionsViewMode'] as core.String
            : null,
        title:
            json_.containsKey('title') ? json_['title'] as core.String : null,
      );