root property

  1. @Deprecated('This method will be removed in 0.19.0. Use [contextWithSpanContext(globalContextManager.active, SpanContext.invalid())] instead.')
Context get root

The root context which all other contexts are derived from.

It should generally not be required to use the root Context directly - instead, use Context.current to operate on the current Context. Only use this context if you are certain you need to disregard the current Context. For example, when instrumenting an asynchronous event handler which may fire while an unrelated Context is "current".

Implementation

@Deprecated(
    'This method will be removed in 0.19.0. Use [contextWithSpanContext(globalContextManager.active, SpanContext.invalid())] instead.')
static Context get root => contextWithSpanContext(
    globalContextManager.active, SpanContext.invalid());