title: How to catch any Flutter exception
body: <p>My application generated code based off some user defined string. The resulting code may not be valid and could produce a UI tree which throws, e.g.,:</p>
  <pre class="lang-dart prettyprint-override"><code>Widget parseUserInput();
  
  parseUserInput('Flexible&gt;Expanded')
  =&gt; Yields: Flexible(child: Expanded(child: Container())
  </code></pre>
  <p>This code throws in Flutter. The exception is caught by Flutter itself.</p>
  <pre><code>======== Exception caught by widgets library =======================================================
  The following assertion was thrown while applying parent data.:
  Incorrect use of ParentDataWidget.
  ...
  </code></pre>
  <p>I cannot catch this exception with <code>try/catch</code> because Flutter is already catching it. I also cannot catch it with MaterialApp's <code>ErrorWidget.builder</code> because that one doesn't seem to be triggered either.</p>
  <p>Is there any other way to catch this? In an ideal world I'd do:</p>
  <pre><code>ErrorWidget(
      onError: revertToLastValidUserInput,
      child: WidgetBuilder(builder: (context) =&gt; parseUserInput(...)
  )
  )
  </code></pre>