ErrListener<T> typedef

ErrListener<T> = void Function({Object? context, T? error, Object? exception, StackTrace? stack})

Signature for a listener used in ErrNotifier and other classes that extend it or hold its instance.

error is an error value of type T (e.g. your custom error type). exception and stack are usually an object of the Exception class or of its subclass, and the stack trace of the exception. context can be whatever information to be added to a log.

Implementation

typedef ErrListener<T> = void Function({
  T? error,
  Object? exception,
  StackTrace? stack,
  Object? context,
});