This class provides the specification for a forked zone.

When forking a new zone (see Zone.fork) one can override the default behavior of the zone by providing callbacks. These callbacks must be given in an instance of this class.

Handlers have the same signature as the same-named methods on Zone but receive three additional arguments:

  1. the zone the handlers are attached to (the "self" zone).
  2. a ZoneDelegate to the parent zone.
  3. the zone that first received the request (before the request was bubbled up).

Handlers can either stop propagation the request (by simply not calling the parent handler), or forward to the parent zone, potentially modifying the arguments on the way.

Properties

createPeriodicTimer CreatePeriodicTimerHandler
read-only

createTimer CreateTimerHandler
read-only

errorCallback ErrorCallbackHandler
read-only

fork ForkHandler
read-only

handleUncaughtError HandleUncaughtErrorHandler
read-only

print PrintHandler
read-only

registerBinaryCallback RegisterBinaryCallbackHandler
read-only

registerCallback RegisterCallbackHandler
read-only

registerUnaryCallback RegisterUnaryCallbackHandler
read-only

run RunHandler
read-only

runBinary RunBinaryHandler
read-only

runUnary RunUnaryHandler
read-only

scheduleMicrotask ScheduleMicrotaskHandler
read-only

Constructors

ZoneSpecification({dynamic handleUncaughtError(Zone self, ZoneDelegate parent, Zone zone, error, StackTrace stackTrace), dynamic run(Zone self, ZoneDelegate parent, Zone zone, dynamic f()), dynamic runUnary(Zone self, ZoneDelegate parent, Zone zone, dynamic f(arg), arg), dynamic runBinary(Zone self, ZoneDelegate parent, Zone zone, dynamic f(arg1, arg2), arg1, arg2), ZoneCallback registerCallback(Zone self, ZoneDelegate parent, Zone zone, dynamic f()), ZoneUnaryCallback registerUnaryCallback(Zone self, ZoneDelegate parent, Zone zone, dynamic f(arg)), ZoneBinaryCallback registerBinaryCallback(Zone self, ZoneDelegate parent, Zone zone, dynamic f(arg1, arg2)), AsyncError errorCallback(Zone self, ZoneDelegate parent, Zone zone, Object error, StackTrace stackTrace), void scheduleMicrotask(Zone self, ZoneDelegate parent, Zone zone, dynamic f()), Timer createTimer(Zone self, ZoneDelegate parent, Zone zone, Duration duration, void f()), Timer createPeriodicTimer(Zone self, ZoneDelegate parent, Zone zone, Duration period, void f(Timer timer)), void print(Zone self, ZoneDelegate parent, Zone zone, String line), Zone fork(Zone self, ZoneDelegate parent, Zone zone, ZoneSpecification specification, Map zoneValues)})
const

Creates a specification with the provided handlers.

ZoneSpecification.from(ZoneSpecification other, {dynamic handleUncaughtError(Zone self, ZoneDelegate parent, Zone zone, error, StackTrace stackTrace): null, dynamic run(Zone self, ZoneDelegate parent, Zone zone, dynamic f()): null, dynamic runUnary(Zone self, ZoneDelegate parent, Zone zone, dynamic f(arg), arg): null, dynamic runBinary(Zone self, ZoneDelegate parent, Zone zone, dynamic f(arg1, arg2), arg1, arg2): null, ZoneCallback registerCallback(Zone self, ZoneDelegate parent, Zone zone, dynamic f()): null, ZoneUnaryCallback registerUnaryCallback(Zone self, ZoneDelegate parent, Zone zone, dynamic f(arg)): null, ZoneBinaryCallback registerBinaryCallback(Zone self, ZoneDelegate parent, Zone zone, dynamic f(arg1, arg2)): null, AsyncError errorCallback(Zone self, ZoneDelegate parent, Zone zone, Object error, StackTrace stackTrace), void scheduleMicrotask(Zone self, ZoneDelegate parent, Zone zone, dynamic f()): null, Timer createTimer(Zone self, ZoneDelegate parent, Zone zone, Duration duration, void f()): null, Timer createPeriodicTimer(Zone self, ZoneDelegate parent, Zone zone, Duration period, void f(Timer timer)): null, void print(Zone self, ZoneDelegate parent, Zone zone, String line): null, Zone fork(Zone self, ZoneDelegate parent, Zone zone, ZoneSpecification specification, Map zoneValues): null})

Creates a specification from other with the provided handlers overriding the ones in other.