Called whenever the Flutter framework catches an error.
The default behavior is to call presentError.
You can set this to your own function to override this default behavior. For example, you could report all errors to your server. Consider calling presentError from your custom error handler in order to see the logs in the console as well.
If the error handler throws an exception, it will not be caught by the Flutter framework.
Set this to null to silently catch and ignore errors. This is not recommended.
- flutter.cn/docs/testing/errors, more information about error handling in Flutter.
static FlutterExceptionHandler? onError = presentError;