tryParse static method

AdImpression? tryParse(
  1. MethodCall call
)

Implementation

static AdImpression? tryParse(MethodCall call) {
  final arguments = call.arguments as Map<dynamic, dynamic>?;

  if (arguments != null) {
    return AdImpression(
      arguments["adType"] as int,
      arguments["cpm"] as double? ?? 0,
      arguments["networkName"] as String? ?? '',
      arguments["priceAccuracy"] as int? ?? 0,
      arguments["versionInfo"] as String? ?? '',
      arguments["creativeIdentifier"] as String?,
      arguments["identifier"] as String? ?? '',
      arguments["impressionDepth"] as int? ?? 0,
      arguments["lifetimeRevenue"] as double? ?? 0,
    );
  }

  return null;
}