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:
- the zone the handlers are attached to (the "self" zone).
- a ZoneDelegate to the parent zone.
-
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({ handleUncaughtError(Zone self, ZoneDelegate parent, Zone zone, error, StackTrace stackTrace), run(Zone self, ZoneDelegate parent, Zone zone, f()), runUnary(Zone self, ZoneDelegate parent, Zone zone, f(arg), arg), runBinary(Zone self, ZoneDelegate parent, Zone zone, f(arg1, arg2), arg1, arg2), registerCallback(Zone self, ZoneDelegate parent, Zone zone, f()), registerUnaryCallback(Zone self, ZoneDelegate parent, Zone zone, f(arg)), registerBinaryCallback(Zone self, ZoneDelegate parent, Zone zone, f(arg1, arg2)), errorCallback(Zone self, ZoneDelegate parent, Zone zone, Object error, StackTrace stackTrace), scheduleMicrotask(Zone self, ZoneDelegate parent, Zone zone, f()), createTimer(Zone self, ZoneDelegate parent, Zone zone, Duration duration, f()), createPeriodicTimer(Zone self, ZoneDelegate parent, Zone zone, Duration period, f(Timer timer)), print(Zone self, ZoneDelegate parent, Zone zone, String line), fork(Zone self, ZoneDelegate parent, Zone zone, ZoneSpecification specification, Map zoneValues)})
-
Creates a specification with the provided handlers.
constfactory - ZoneSpecification.from(ZoneSpecification other, { handleUncaughtError(Zone self, ZoneDelegate parent, Zone zone, error, StackTrace stackTrace): null, run(Zone self, ZoneDelegate parent, Zone zone, f()): null, runUnary(Zone self, ZoneDelegate parent, Zone zone, f(arg), arg): null, runBinary(Zone self, ZoneDelegate parent, Zone zone, f(arg1, arg2), arg1, arg2): null, registerCallback(Zone self, ZoneDelegate parent, Zone zone, f()): null, registerUnaryCallback(Zone self, ZoneDelegate parent, Zone zone, f(arg)): null, registerBinaryCallback(Zone self, ZoneDelegate parent, Zone zone, f(arg1, arg2)): null, errorCallback(Zone self, ZoneDelegate parent, Zone zone, Object error, StackTrace stackTrace), scheduleMicrotask(Zone self, ZoneDelegate parent, Zone zone, f()): null, createTimer(Zone self, ZoneDelegate parent, Zone zone, Duration duration, f()): null, createPeriodicTimer(Zone self, ZoneDelegate parent, Zone zone, Duration period, f(Timer timer)): null, print(Zone self, ZoneDelegate parent, Zone zone, String line): null, fork(Zone self, ZoneDelegate parent, Zone zone, ZoneSpecification specification, Map zoneValues): null})
-
Creates a specification from
other
with the provided handlers overriding the ones inother
.factory
Properties
- createPeriodicTimer → CreatePeriodicTimerHandler
-
read-only
- createTimer → CreateTimerHandler
-
read-only
- errorCallback → ErrorCallbackHandler
-
read-only
- fork → ForkHandler
-
read-only
- handleUncaughtError → HandleUncaughtErrorHandler
-
read-only
- hashCode → int
-
Get a hash code for this object.…
read-only, inherited - print → PrintHandler
-
read-only
- registerBinaryCallback → RegisterBinaryCallbackHandler
-
read-only
- registerCallback → RegisterCallbackHandler
-
read-only
- registerUnaryCallback → RegisterUnaryCallbackHandler
-
read-only
- run → RunHandler
-
read-only
- runBinary → RunBinaryHandler
-
read-only
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited - runUnary → RunUnaryHandler
-
read-only
- scheduleMicrotask → ScheduleMicrotaskHandler
-
read-only
Operators
-
operator ==(
other) → bool -
The equality operator.…
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