SolarPotential.fromJson constructor

SolarPotential.fromJson(
  1. Map json_
)

Implementation

SolarPotential.fromJson(core.Map json_)
    : this(
        buildingStats: json_.containsKey('buildingStats')
            ? SizeAndSunshineStats.fromJson(
                json_['buildingStats'] as core.Map<core.String, core.dynamic>)
            : null,
        carbonOffsetFactorKgPerMwh:
            json_.containsKey('carbonOffsetFactorKgPerMwh')
                ? (json_['carbonOffsetFactorKgPerMwh'] as core.num).toDouble()
                : null,
        financialAnalyses: json_.containsKey('financialAnalyses')
            ? (json_['financialAnalyses'] as core.List)
                .map((value) => FinancialAnalysis.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        maxArrayAreaMeters2: json_.containsKey('maxArrayAreaMeters2')
            ? (json_['maxArrayAreaMeters2'] as core.num).toDouble()
            : null,
        maxArrayPanelsCount: json_.containsKey('maxArrayPanelsCount')
            ? json_['maxArrayPanelsCount'] as core.int
            : null,
        maxSunshineHoursPerYear: json_.containsKey('maxSunshineHoursPerYear')
            ? (json_['maxSunshineHoursPerYear'] as core.num).toDouble()
            : null,
        panelCapacityWatts: json_.containsKey('panelCapacityWatts')
            ? (json_['panelCapacityWatts'] as core.num).toDouble()
            : null,
        panelHeightMeters: json_.containsKey('panelHeightMeters')
            ? (json_['panelHeightMeters'] as core.num).toDouble()
            : null,
        panelLifetimeYears: json_.containsKey('panelLifetimeYears')
            ? json_['panelLifetimeYears'] as core.int
            : null,
        panelWidthMeters: json_.containsKey('panelWidthMeters')
            ? (json_['panelWidthMeters'] as core.num).toDouble()
            : null,
        roofSegmentStats: json_.containsKey('roofSegmentStats')
            ? (json_['roofSegmentStats'] as core.List)
                .map((value) => RoofSegmentSizeAndSunshineStats.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        solarPanelConfigs: json_.containsKey('solarPanelConfigs')
            ? (json_['solarPanelConfigs'] as core.List)
                .map((value) => SolarPanelConfig.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        solarPanels: json_.containsKey('solarPanels')
            ? (json_['solarPanels'] as core.List)
                .map((value) => SolarPanel.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        wholeRoofStats: json_.containsKey('wholeRoofStats')
            ? SizeAndSunshineStats.fromJson(json_['wholeRoofStats']
                as core.Map<core.String, core.dynamic>)
            : null,
      );