ZoneSpecification 构造函数
- {HandleUncaughtErrorHandler? handleUncaughtError,
- RunHandler? run,
- RunUnaryHandler? runUnary,
- RunBinaryHandler? runBinary,
- RegisterCallbackHandler? registerCallback,
- RegisterUnaryCallbackHandler? registerUnaryCallback,
- RegisterBinaryCallbackHandler? registerBinaryCallback,
- ErrorCallbackHandler? errorCallback,
- ScheduleMicrotaskHandler? scheduleMicrotask,
- CreateTimerHandler? createTimer,
- CreatePeriodicTimerHandler? createPeriodicTimer,
- PrintHandler? print,
- ForkHandler? fork}
使用提供的处理器创建规范。
如果提供了 handleUncaughtError
,则新区域将成为一个新的“错误区域”,这将防止错误流到其他错误区域(参见 Zone.errorZone,Zone.inSameErrorZone)。
实现方式
const factory ZoneSpecification(
{HandleUncaughtErrorHandler? handleUncaughtError,
RunHandler? run,
RunUnaryHandler? runUnary,
RunBinaryHandler? runBinary,
RegisterCallbackHandler? registerCallback,
RegisterUnaryCallbackHandler? registerUnaryCallback,
RegisterBinaryCallbackHandler? registerBinaryCallback,
ErrorCallbackHandler? errorCallback,
ScheduleMicrotaskHandler? scheduleMicrotask,
CreateTimerHandler? createTimer,
CreatePeriodicTimerHandler? createPeriodicTimer,
PrintHandler? print,
ForkHandler? fork}) = _ZoneSpecification;