Best practice to report errors in Flutter

Posted by Jennifer | Updated on

Best practice to report errors in Flutter

The behavior you are seeing is the default behavior for Crashlytics on Flutter, at least for now. If you want to exit your app I can recommend you the following options:

  1. Navigate to an error screen, showing a generic error message using Navigator.pushAndRemoveUntil(). then when the user clicks OK or after a timer, you exit the app. In order to exit the App you can throw and exception on the native side or use SystemChannels.platform.invokeMethod('SystemNavigator.pop'); although your App might be blocked at the App Store, as Apple rejects programatically exits.
  2. Be careful to have an error screen, with a friendly error message, ready for each possible error, so the user won’t have to exit the app.

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