NativeContent.fromJson constructor

NativeContent.fromJson(
  1. Map _json
)

Implementation

NativeContent.fromJson(core.Map _json)
    : this(
        advertiserName: _json.containsKey('advertiserName')
            ? _json['advertiserName'] as core.String
            : null,
        appIcon: _json.containsKey('appIcon')
            ? Image.fromJson(
                _json['appIcon'] as core.Map<core.String, core.dynamic>)
            : null,
        body: _json.containsKey('body') ? _json['body'] as core.String : null,
        callToAction: _json.containsKey('callToAction')
            ? _json['callToAction'] as core.String
            : null,
        clickLinkUrl: _json.containsKey('clickLinkUrl')
            ? _json['clickLinkUrl'] as core.String
            : null,
        clickTrackingUrl: _json.containsKey('clickTrackingUrl')
            ? _json['clickTrackingUrl'] as core.String
            : null,
        headline: _json.containsKey('headline')
            ? _json['headline'] as core.String
            : null,
        image: _json.containsKey('image')
            ? Image.fromJson(
                _json['image'] as core.Map<core.String, core.dynamic>)
            : null,
        logo: _json.containsKey('logo')
            ? Image.fromJson(
                _json['logo'] as core.Map<core.String, core.dynamic>)
            : null,
        priceDisplayText: _json.containsKey('priceDisplayText')
            ? _json['priceDisplayText'] as core.String
            : null,
        starRating: _json.containsKey('starRating')
            ? (_json['starRating'] as core.num).toDouble()
            : null,
        storeUrl: _json.containsKey('storeUrl')
            ? _json['storeUrl'] as core.String
            : null,
        videoUrl: _json.containsKey('videoUrl')
            ? _json['videoUrl'] as core.String
            : null,
      );