stopSpan method

  1. @override
Future<bool> stopSpan(
  1. String spanId, {
  2. ErrorCode? errorCode,
  3. int? endTimeMs,
})
override

Stop an active span. Returns true if the span is stopped after the method returns and false otherwise.

Implementation

@override
Future<bool> stopSpan(
  String spanId, {
  ErrorCode? errorCode,
  int? endTimeMs,
}) async {
  throwIfNotStarted();
  return await methodChannel.invokeMethod(_stopSpanMethodName, {
    _spanIdArgName: spanId,
    _errorCodeArgName: errorCode?.name,
    _endTimeMsArgName: endTimeMs,
  }) as bool;
}