ZoneSpecification class

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.

Constructors

ZoneSpecification({HandleUncaughtErrorHandler handleUncaughtError, RunHandler<R> run, RunUnaryHandler<R, T> runUnary, RunBinaryHandler<R, T1, T2> runBinary, RegisterCallbackHandler<R> registerCallback, RegisterUnaryCallbackHandler<R, T> registerUnaryCallback, RegisterBinaryCallbackHandler<R, T1, T2> registerBinaryCallback, ErrorCallbackHandler errorCallback, ScheduleMicrotaskHandler scheduleMicrotask, CreateTimerHandler createTimer, CreatePeriodicTimerHandler createPeriodicTimer, PrintHandler print, ForkHandler fork })
Creates a specification with the provided handlers.
const
factory
ZoneSpecification.from(ZoneSpecification other, { HandleUncaughtErrorHandler handleUncaughtError: null, RunHandler<R> run: null, RunUnaryHandler<R, T> runUnary: null, RunBinaryHandler<R, T1, T2> runBinary: null, RegisterCallbackHandler<R> registerCallback: null, RegisterUnaryCallbackHandler<R, T> registerUnaryCallback: null, RegisterBinaryCallbackHandler<R, T1, T2> registerBinaryCallback: null, ErrorCallbackHandler errorCallback: null, ScheduleMicrotaskHandler scheduleMicrotask: null, CreateTimerHandler createTimer: null, CreatePeriodicTimerHandler createPeriodicTimer: null, PrintHandler print: null, ForkHandler fork: null })
Creates a specification from other with the provided handlers overriding the ones in other.
factory

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<R, T1, T2>
read-only
registerCallback RegisterCallbackHandler<R>
read-only
registerUnaryCallback RegisterUnaryCallbackHandler<R, T>
read-only
run RunHandler<R>
read-only
runBinary RunBinaryHandler<R, T1, T2>
read-only
runUnary RunUnaryHandler<R, T>
read-only
scheduleMicrotask ScheduleMicrotaskHandler
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited