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.

const _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( f(arg1, arg2), {bool runGuarded: true}) → ZoneBinaryCallback

Equivalent to:…

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

Equivalent to:…

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

Equivalent to:…

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

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

createTimer(Duration duration, callback()) → Timer

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

errorCallback(Object error, StackTrace stackTrace) → AsyncError

Intercepts errors when added programmtically 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( callback(arg1, arg2)) → ZoneBinaryCallback

Registers the given callback in this zone.…

registerCallback( callback()) → ZoneCallback

Registers the given callback in this zone.…

registerUnaryCallback( callback(arg)) → ZoneUnaryCallback

Registers the given callback in this zone.…

run( f()) → dynamic

Executes the given function f in this zone.

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

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

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

Executes the given callback f in this zone.…

runGuarded( f()) → dynamic

Executes the given function f in this zone.…

runUnary( f(arg), arg) → dynamic

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

runUnaryGuarded( f(arg), arg) → dynamic

Executes the given callback f in this zone.…

scheduleMicrotask( f()) → void

Runs f asynchronously in this zone.

toString() → String

Returns a string representation of this object.

inherited