trackEvent method

Future<void> trackEvent(
  1. String event,
  2. int? time,
  3. String? category,
  4. String? label,
  5. int? value,
  6. String? customFieldsJson,
  7. String? shopId,
)

customFieldsJson is JSON object string or null (maps to native custom fields map).

Implementation

Future<void> trackEvent(
  String event,
  int? time,
  String? category,
  String? label,
  int? value,
  String? customFieldsJson,
  String? shopId,
) async {
  final String pigeonVar_channelName =
      'dev.flutter.pigeon.personalization_flutter_sdk.PersonalizationHostApi.trackEvent$pigeonVar_messageChannelSuffix';
  final BasicMessageChannel<Object?> pigeonVar_channel =
      BasicMessageChannel<Object?>(
        pigeonVar_channelName,
        pigeonChannelCodec,
        binaryMessenger: pigeonVar_binaryMessenger,
      );
  final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
    <Object?>[event, time, category, label, value, customFieldsJson, 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;
  }
}