sendAnalyticsEvent method

void sendAnalyticsEvent(
  1. String event
)
inherited

Sends an analytics event, provided the analytics are enabled. Invoked from BetterCommandRunner upon command execution with the event name, or command name if applicable. Can be overridden to customize the event sending behavior.

Implementation

void sendAnalyticsEvent(final String event) {
  if (analyticsEnabled()) {
    try {
      onAnalyticsEvent?.call(event);
    } catch (_) {
      // Silently ignore analytics sending errors to not disrupt the main flow
    }
  }
}