trackEvent method

void trackEvent(
  1. SnowplowTracker tracker,
  2. bool ignoreTrackerNamespace
)

Tracks the event using the provided tracker. Respects the ignoreTrackerNamespace flag or matches against provided namespaces.

Implementation

void trackEvent(SnowplowTracker tracker, bool ignoreTrackerNamespace) {
  if (ignoreTrackerNamespace ||
      (trackers ?? []).isEmpty ||
      trackers!.contains(tracker.namespace)) {
    tracker.track(event.toEvent(), contexts: contexts);
  }
}