CloudXAd.fromMap constructor

CloudXAd.fromMap(
  1. Map<Object?, Object?>? map
)

Creates a CloudXAd from a map received from the platform channel.

Returns an empty CloudXAd if map is null.

Implementation

factory CloudXAd.fromMap(Map<Object?, Object?>? map) {
  if (map == null) {
    return const CloudXAd();
  }

  return CloudXAd(
    placementName: map['placementName'] as String?,
    placementId: map['placementId'] as String?,
    bidder: map['bidder'] as String?,
    externalPlacementId: map['externalPlacementId'] as String?,
    revenue:
        map['revenue'] != null ? (map['revenue'] as num).toDouble() : null,
  );
}