reporter property

void Function(Object error, StackTrace stack)? get reporter

The reporter for the current zone, or the process-wide one.

Reading prefers whatever runWith installed, so a router's own sink wins over anything set globally.

Implementation

static void Function(Object error, StackTrace stack)? get reporter {
  final scoped = Zone.current[_zoneKey];
  if (scoped is void Function(Object, StackTrace)) return scoped;
  return _fallback;
}
set reporter (void sink(Object error, StackTrace stack)?)

Sets the reporter used wherever no router installed one.

Implementation

static set reporter(void Function(Object error, StackTrace stack)? sink) {
  _fallback = sink;
}