runScopedGuarded<R> function

R? runScopedGuarded<R>(
  1. R body(), {
  2. required void onError(
    1. Object error,
    2. StackTrace stack
    ),
  3. Set<ScopedRef> values = const {},
})

Runs body within a scope which has access to the set of refs in values.

Implementation

R? runScopedGuarded<R>(
  R Function() body, {
  required void Function(Object error, StackTrace stack) onError,
  Set<ScopedRef<dynamic>> values = const {},
}) {
  return runZonedGuarded(
    body,
    onError,
    zoneValues: {for (final value in values) value._key: value},
  );
}