title: try/catch not working on network image (Exception: Invalid image data)
body: <p>I have get network image and used  ternary operator where I can show network image but unable to show default asset image where network image is invalid <a href="https://i.stack.imgur.com/sy07I.png" rel="noreferrer">default image in grid</a> also as this-</p>
  <p>I am new to flutter</p>
  <pre><code> image: NetworkImage(products[index]
                                                .productImageList[0]
                                    )!= null
                                        ? NetworkImage(
                                        products[index].productImageList[0])
                                        :Image.asset(&quot;assets/defimg.jpg&quot;),
                                    fit: BoxFit.fitHeight ),
  </code></pre>
  <p>it shows network image on index 0 but does not load  asset image where network image is invalid or null and throw this error-</p>
  <pre><code>════════ Exception caught by image resource service ════════════════════════════════════════════════
  The following _Exception was thrown resolving an image codec:
  Exception: Invalid image data
  
  When the exception was thrown, this was the stack: 
  #0      _futurize (dart:ui/painting.dart:5230:5)
  #1      ImageDescriptor.encoded (dart:ui/painting.dart:5098:12)
  #2      instantiateImageCodec (dart:ui/painting.dart:1998:60)
  &lt;asynchronous suspension&gt;
  </code></pre>
  <p>after this i tried try/catch -my code with try catch is --</p>
  <pre><code>child: Builder(builder: (BuildContext context) {
                                try {
                                  return Center(
                                    child: Image.network(
                                        products[index]
                                                  .productImageList[0],
                                        fit: BoxFit.contain,
                                    ),
                                  );
                                } catch (e) {
                                  print(&quot;Got exception ${e.toString()}&quot;);
                                  return Image.asset(&quot;assets/defimg.jpg&quot;, fit: BoxFit.contain);
                                }
                              }),
  
  </code></pre>
  <p>give me same error as above..</p>
  <p>image response come from api in a list &quot;productImageList&quot; as shown bellow --</p>
  <pre><code>            &quot;sellingPrice&quot;: &quot;4000&quot;,
              &quot;productImageList&quot;: [
                  &quot;https://www.xyzz.com/postadsimages/img/23682201.jpg&quot;
              ],
              &quot;createdDate&quot;: 1607754473000,
  
  </code></pre>