end method

void end()

Ends the action. Idempotent: detaches context, then ends the span.

Implementation

void end() {
  if (_ended) return;
  _ended = true;
  final token = _token;
  if (token != null) {
    Context.detach(token);
  }
  _span?.end();
}