runWithImageLoadContext<R> function

R runWithImageLoadContext<R>(
  1. Context context,
  2. R body(), {
  3. Map<Object?, Object?> zoneValues = const {},
})

Runs body with context as the ambient image.load parent, readable by nested instrumentation via currentImageLoadContext.

Implementation

R runWithImageLoadContext<R>(
  Context context,
  R Function() body, {
  Map<Object?, Object?> zoneValues = const {},
}) {
  return runZoned(
    body,
    zoneValues: {...zoneValues, imageLoadContextZoneKey: context},
  );
}