endApiTracking method

Future<void> endApiTracking({
  1. required String? trackId,
  2. int? statusCode,
  3. String? errorMessage,
})

Closes a tracking span previously opened by startApiTracking.

trackId must be the id returned by startApiTracking. If trackId is null this is a no-op — convenient when the start call was excluded or failed.

Implementation

Future<void> endApiTracking({
  required String? trackId,
  int? statusCode,
  String? errorMessage,
}) {
  if (trackId == null) return Future<void>.value();
  return AppticsFlutterPlatform.instance.endApiTracking(
    trackId: trackId,
    statusCode: statusCode,
    errorMessage: errorMessage,
  );
}