enableAutoTracking method

void enableAutoTracking()

Enables automatic tracking of all HTTP calls made via dart:io's HttpClient by setting a global HttpOverrides.

This captures calls from the http package, Dio (when using the default adapter), and any library built on dart:io.

Note: Only one global HttpOverrides can be active. If another library also sets HttpOverrides.global, there may be conflicts.

Implementation

void enableAutoTracking() {
  if (_autoTrackingEnabled) return;
  _previousOverrides = HttpOverrides.current;
  HttpOverrides.global = AppticsHttpOverrides(this, _previousOverrides);
  _autoTrackingEnabled = true;
}