Dart explicitly makes a distinction between Error, that signals a problem in your code\'s logic and should never happen and should never be caught and Exceptions that signal
As asserts are ignored in production mode, you should use them as way to do initial tests to your code logic in debug mode:
In production code, assertions are ignored, and the arguments to assert aren’t evaluated.