AppErrorHandler constructor

AppErrorHandler({
  1. FlutterExceptionHandler? handler,
  2. ErrorWidgetBuilder? builder,
  3. ReportErrorHandler? report,
  4. bool allowNewHandlers = true,
})

Implementation

factory AppErrorHandler({
  FlutterExceptionHandler? handler,
  ErrorWidgetBuilder? builder,
  ReportErrorHandler? report,
  bool allowNewHandlers = true,
}) {
  _this ??= AppErrorHandler._(builder);

  /// Allows you to set an error handler more than once.
  set(handler: handler, builder: builder, report: report);

  // Once set to false, you can't assign different handlers anymore.
  if (!allowNewHandlers) {
    _allowNewHandlers = false;
  }
  return _this!;
}