A Zone represents the asynchronous version of a dynamic extent. Asynchronous callbacks are executed in the zone they have been queued in. For example, the callback of a future.then is executed in the same zone as the one where the then was invoked.

Constants

ROOT → Zone

The root zone that is implicitly created.

_ROOT_ZONE

Static Properties

current → Zone

read-only

Properties

errorZone → Zone

The error zone is the one that is responsible for dealing with uncaught errors. Errors are not allowed to cross between zones with different error-zones.

read-only
hashCode → int

Get a hash code for this object.

read-only, inherited
parent → Zone

Returns the parent zone.

read-only
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) → bool

The equality operator.

inherited
operator [](Object key) → dynamic

Retrieves the zone-value associated with key.

Methods

bindBinaryCallback(dynamic f(arg1, arg2), {bool runGuarded: true}) → ZoneBinaryCallback

Equivalent to:

bindCallback(dynamic f(), {bool runGuarded: true}) → ZoneCallback

Equivalent to:

bindUnaryCallback(dynamic f(arg), {bool runGuarded: true}) → ZoneUnaryCallback

Equivalent to:

createPeriodicTimer(Duration period, void callback(Timer timer)) → Timer

Creates a periodic Timer where the callback is executed in this zone.

createTimer(Duration duration, void callback()) → Timer

Creates a Timer where the callback is executed in this zone.

errorCallback(Object error, StackTrace stackTrace) → AsyncError

Intercepts errors when added programmatically to a Future or Stream.

fork({ZoneSpecification specification, Map zoneValues}) → Zone

Creates a new zone as a child of this.

handleUncaughtError(error, StackTrace stackTrace) → dynamic

inSameErrorZone(Zone otherZone) → bool

Returns true if this and otherZone are in the same error zone.

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
print(String line) → void

Prints the given line.

registerBinaryCallback(dynamic callback(arg1, arg2)) → ZoneBinaryCallback

Registers the given callback in this zone.

registerCallback(dynamic callback()) → ZoneCallback

Registers the given callback in this zone.

registerUnaryCallback(dynamic callback(arg)) → ZoneUnaryCallback

Registers the given callback in this zone.

run(dynamic f()) → dynamic

Executes the given function f in this zone.

runBinary(dynamic f(arg1, arg2), arg1, arg2) → dynamic

Executes the given callback f with argument arg1 and arg2 in this zone.

runBinaryGuarded(dynamic f(arg1, arg2), arg1, arg2) → dynamic

Executes the given callback f in this zone.

runGuarded(dynamic f()) → dynamic

Executes the given function f in this zone.

runUnary(dynamic f(arg), arg) → dynamic

Executes the given callback f with argument arg in this zone.

runUnaryGuarded(dynamic f(arg), arg) → dynamic

Executes the given callback f in this zone.

scheduleMicrotask(void f()) → void

Runs f asynchronously in this zone.

toString() → String

Returns a string representation of this object.

inherited