registerAdd2CartEvent method
Future<Map<String, dynamic> ?>
registerAdd2CartEvent({
- required String cliUbid,
- double? price,
- required String skuId,
- String? merchantId,
- TrackingParams? trackingParams,
override
Registers an "add to cart" event.
Parameters:
cliUbid: The unique client ID for the user.price: The price of the product added to the cart (optional).skuId: The SKU ID of the product added to the cart.merchantId: The ID of the merchant selling the product (optional).trackingParams: Additional parameters for the event (optional).
A Future that resolves to a Map<String, dynamic>?, indicating the result of registering the "add to cart" event.
Example:
var response = await RegisterEvent.registerAdd2CartEvent(
cliUbid: "dfbfee0554bf1de6dfe801dc32d91ab9f15c534ee396a00e7fcbc5930769d109",
price: "95",
skuId: "2777503___Astore___Anet",
merchantId: "whitakers",
trackingParams: {"product_quantities": "1", "store_id": "1"},
);
Implementation
@override
Future<Map<String, dynamic>?> registerAdd2CartEvent({
required String cliUbid,
double? price,
required String skuId,
String? merchantId,
TrackingParams? trackingParams,
}) async {
final result = await MethodHandler.invokeNativeMethod(
'registerAdd2CartEvent',
arguments: {
'cliUbid': cliUbid,
'price': price,
'skuId': skuId,
'merchantId': merchantId,
'trackingParams': convertTrackingParamsToMap(trackingParams) ?? {},
});
return Map<String, dynamic>.from(result ?? {});
}