presentProductWithIdentifier method Null safety

Future<PresentPresentationResult> presentProductWithIdentifier(
  1. String productVendorId,
  2. [String? presentationVendorId,
  3. String? contentId]
)

Implementation

static Future<PresentPresentationResult> presentProductWithIdentifier(
    String productVendorId,
    [String? presentationVendorId,
    String? contentId]) async {
  final result = await _channel
      .invokeMethod('presentPresentationWithIdentifier', <String, dynamic>{
    'productVendorId': productVendorId,
    'presentationVendorId': presentationVendorId,
    'contentId': contentId
  });
  PLYPlan? plan;
  if (!result['plan'].isEmpty) plan = transformToPLYPlan(result['plan']);

  return PresentPresentationResult(
      PLYPurchaseResult.values[result['result']], plan);
}