BackgroundTasks constructor

BackgroundTasks({
  1. void onError(
    1. Object error,
    2. StackTrace stack
    )?,
})

Creates an empty registry.

onError is told when a task throws. It defaults to the router's error reporter, so a failing task surfaces the same way a failing handler does rather than vanishing.

Implementation

BackgroundTasks({void Function(Object error, StackTrace stack)? onError})
    : _onError = onError;