trackPurchase method

Future<void> trackPurchase(
  1. String orderId,
  2. double orderPrice,
  3. List<PurchaseLineItemWire> items,
  4. String? deliveryType,
  5. String? deliveryAddress,
  6. String? paymentType,
  7. bool isTaxFree,
  8. bool isGiftPackage,
  9. String? promocode,
  10. double? orderCash,
  11. double? orderBonuses,
  12. double? orderDelivery,
  13. double? orderDiscount,
  14. String? channel,
  15. String? customJson,
  16. String? recommendedSourceJson,
  17. String? stream,
  18. String? segment,
  19. String? shopId,
)

customJson and recommendedSourceJson are JSON object strings or null.

Implementation

Future<void> trackPurchase(String orderId, double orderPrice, List<PurchaseLineItemWire> items, String? deliveryType, String? deliveryAddress, String? paymentType, bool isTaxFree, bool isGiftPackage, String? promocode, double? orderCash, double? orderBonuses, double? orderDelivery, double? orderDiscount, String? channel, String? customJson, String? recommendedSourceJson, String? stream, String? segment, String? shopId) async {
  final String pigeonVar_channelName = 'dev.flutter.pigeon.personalization_flutter_sdk.PersonalizationHostApi.trackPurchase$pigeonVar_messageChannelSuffix';
  final BasicMessageChannel<Object?> pigeonVar_channel = BasicMessageChannel<Object?>(
    pigeonVar_channelName,
    pigeonChannelCodec,
    binaryMessenger: pigeonVar_binaryMessenger,
  );
  final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[orderId, orderPrice, items, deliveryType, deliveryAddress, paymentType, isTaxFree, isGiftPackage, promocode, orderCash, orderBonuses, orderDelivery, orderDiscount, channel, customJson, recommendedSourceJson, stream, segment, shopId]);
  final List<Object?>? pigeonVar_replyList =
      await pigeonVar_sendFuture as List<Object?>?;
  if (pigeonVar_replyList == null) {
    throw _createConnectionError(pigeonVar_channelName);
  } else if (pigeonVar_replyList.length > 1) {
    throw PlatformException(
      code: pigeonVar_replyList[0]! as String,
      message: pigeonVar_replyList[1] as String?,
      details: pigeonVar_replyList[2],
    );
  } else {
    return;
  }
}