ForkHandler typedef Null safety

Zone ForkHandler (
  1. Zone self,
  2. ZoneDelegate parent,
  3. Zone zone,
  4. ZoneSpecification? specification,
  5. Map<Object?, Object?>? zoneValues
)

The type of a custom Zone.fork implementation function.

Receives the Zone that the handler was registered on as self, a delegate forwarding to the handlers of self's parent zone as parent, and the current zone where the error was uncaught as zone, which will have self as a parent zone.

The handler should create a new zone with zone as its immediate parent zone.

The specification and zoneValues are the ones which were passed to Zone.fork of zone. They specify the custom zone handlers and zone variables that the new zone should have.

The custom handler can change the specification or zone values before calling parent.fork(zone, specification, zoneValues), but it has to call the parent's ZoneDelegate.fork in order to create a valid Zone object.

Implementation

typedef Zone ForkHandler(Zone self, ZoneDelegate parent, Zone zone,
    ZoneSpecification? specification, Map<Object?, Object?>? zoneValues);