copyWithSpanContext method

Context copyWithSpanContext(
  1. SpanContext spanContext
)

Creates a new Context with the given SpanContext.

This sets only the span context and not an active span.

Implementation

Context copyWithSpanContext(SpanContext spanContext) {
  final newContext = ContextCreate.create(contextMap: {
    ..._values,
    _spanContextKey: spanContext,
  });
  return newContext;
}