LighthouseResultV5.fromJson constructor

LighthouseResultV5.fromJson(
  1. Map json_
)

Implementation

LighthouseResultV5.fromJson(core.Map json_)
    : this(
        audits: json_.containsKey('audits')
            ? (json_['audits'] as core.Map<core.String, core.dynamic>).map(
                (key, value) => core.MapEntry(
                  key,
                  LighthouseAuditResultV5.fromJson(
                      value as core.Map<core.String, core.dynamic>),
                ),
              )
            : null,
        categories: json_.containsKey('categories')
            ? Categories.fromJson(
                json_['categories'] as core.Map<core.String, core.dynamic>)
            : null,
        categoryGroups: json_.containsKey('categoryGroups')
            ? (json_['categoryGroups'] as core.Map<core.String, core.dynamic>)
                .map(
                (key, value) => core.MapEntry(
                  key,
                  CategoryGroupV5.fromJson(
                      value as core.Map<core.String, core.dynamic>),
                ),
              )
            : null,
        configSettings: json_.containsKey('configSettings')
            ? ConfigSettings.fromJson(json_['configSettings']
                as core.Map<core.String, core.dynamic>)
            : null,
        entities: json_.containsKey('entities')
            ? (json_['entities'] as core.List)
                .map((value) => LhrEntity.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        environment: json_.containsKey('environment')
            ? Environment.fromJson(
                json_['environment'] as core.Map<core.String, core.dynamic>)
            : null,
        fetchTime: json_.containsKey('fetchTime')
            ? json_['fetchTime'] as core.String
            : null,
        finalDisplayedUrl: json_.containsKey('finalDisplayedUrl')
            ? json_['finalDisplayedUrl'] as core.String
            : null,
        finalUrl: json_.containsKey('finalUrl')
            ? json_['finalUrl'] as core.String
            : null,
        fullPageScreenshot: json_.containsKey('fullPageScreenshot')
            ? json_['fullPageScreenshot']
            : null,
        i18n: json_.containsKey('i18n')
            ? I18n.fromJson(
                json_['i18n'] as core.Map<core.String, core.dynamic>)
            : null,
        lighthouseVersion: json_.containsKey('lighthouseVersion')
            ? json_['lighthouseVersion'] as core.String
            : null,
        mainDocumentUrl: json_.containsKey('mainDocumentUrl')
            ? json_['mainDocumentUrl'] as core.String
            : null,
        requestedUrl: json_.containsKey('requestedUrl')
            ? json_['requestedUrl'] as core.String
            : null,
        runWarnings: json_.containsKey('runWarnings')
            ? json_['runWarnings'] as core.List
            : null,
        runtimeError: json_.containsKey('runtimeError')
            ? RuntimeError.fromJson(
                json_['runtimeError'] as core.Map<core.String, core.dynamic>)
            : null,
        stackPacks: json_.containsKey('stackPacks')
            ? (json_['stackPacks'] as core.List)
                .map((value) => StackPack.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        timing: json_.containsKey('timing')
            ? Timing.fromJson(
                json_['timing'] as core.Map<core.String, core.dynamic>)
            : null,
        userAgent: json_.containsKey('userAgent')
            ? json_['userAgent'] as core.String
            : null,
      );