withContext<T> function

T withContext<T>(
  1. Context context,
  2. T fn()
)

Runs fn in the specified context.

Implementation

T withContext<T>(Context context, T Function() fn) {
  return runZoned(() => fn(), zoneValues: {#z3_context: context});
}