asCurrent<T> method

T asCurrent<T>(
  1. T body()
)

Runs body with this as StackTraceFormatter.current.

This is zone-scoped, so this will be the current configuration in any asynchronous callbacks transitively created by body.

Implementation

T asCurrent<T>(T Function() body) =>
    runZoned(body, zoneValues: {_currentKey: this});