How to catch and report Flutter errors

Posted by Andre Scott | Updated on

In addition to Dart errors, Flutter can throw errors such as platform exceptions that occur when calling native code. Be sure to capture and report these types of errors as well.

To capture Flutter errors, override the FlutterError.onError property. If you’re in debug mode, use a convenience function from Flutter to properly format the error. If you’re in production mode, send the error to the onError callback defined in the previous step.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers