ZoneSpecification.from constructor

ZoneSpecification.from(
  1. ZoneSpecification other,
  2. {HandleUncaughtErrorHandler? handleUncaughtError,
  3. R run(
    1. Zone self,
    2. ZoneDelegate parent,
    3. Zone zone,
    4. R f( )
    ),
  4. R runUnary(
    1. Zone self,
    2. ZoneDelegate parent,
    3. Zone zone,
    4. R f(
      1. T arg
      ),
    5. T arg
    ),
  5. R runBinary(
    1. Zone self,
    2. ZoneDelegate parent,
    3. Zone zone,
    4. R f(
      1. T1 arg1,
      2. T2 arg2
      ),
    5. T1 arg1,
    6. T2 arg2
    ),
  6. ZoneCallback<R> registerCallback(
    1. Zone self,
    2. ZoneDelegate parent,
    3. Zone zone,
    4. R f( )
    ),
  7. ZoneUnaryCallback<R, T> registerUnaryCallback(
    1. Zone self,
    2. ZoneDelegate parent,
    3. Zone zone,
    4. R f(
      1. T arg
      )
    ),
  8. ZoneBinaryCallback<R, T1, T2> registerBinaryCallback(
    1. Zone self,
    2. ZoneDelegate parent,
    3. Zone zone,
    4. R f(
      1. T1 arg1,
      2. T2 arg2
      )
    ),
  9. ErrorCallbackHandler? errorCallback,
  10. ScheduleMicrotaskHandler? scheduleMicrotask,
  11. CreateTimerHandler? createTimer,
  12. CreatePeriodicTimerHandler? createPeriodicTimer,
  13. PrintHandler? print,
  14. ForkHandler? fork}
)

Creates a specification from other and provided handlers.

The created zone specification has the handlers of other and any individually provided handlers. If a handler is provided both through other and individually, the individually provided handler overries the one from other.

Implementation

factory ZoneSpecification.from(ZoneSpecification other,
    {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}) {
  return new ZoneSpecification(
      handleUncaughtError: handleUncaughtError ?? other.handleUncaughtError,
      run: run ?? other.run,
      runUnary: runUnary ?? other.runUnary,
      runBinary: runBinary ?? other.runBinary,
      registerCallback: registerCallback ?? other.registerCallback,
      registerUnaryCallback:
          registerUnaryCallback ?? other.registerUnaryCallback,
      registerBinaryCallback:
          registerBinaryCallback ?? other.registerBinaryCallback,
      errorCallback: errorCallback ?? other.errorCallback,
      scheduleMicrotask: scheduleMicrotask ?? other.scheduleMicrotask,
      createTimer: createTimer ?? other.createTimer,
      createPeriodicTimer: createPeriodicTimer ?? other.createPeriodicTimer,
      print: print ?? other.print,
      fork: fork ?? other.fork);
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-async/ZoneSpecification/ZoneSpecification.from.html