Reporting error cases aggressively

Not all error conditions can be designed out. For those that remain,
in debug builds, Flutter generally attempts to catch the errors very
early and immediately reports them. Asserts are widely used.
Constructor arguments are sanity checked in detail. Lifecycles are
monitored and when inconsistencies are detected they immediately
cause an exception to be thrown.

In some cases, this is taken to extremes: for example, when running
unit tests, regardless of what else the test is doing, every RenderBox
subclass that is laid out aggressively inspects whether its intrinsic
sizing methods fulfill the intrinsic sizing contract. This helps catch
errors in APIs that might otherwise not be exercised.