title: What is better way to know if Image.network has loaded and store it in a state using Riverpod?
body: <p>I just want to ask if is there a better way to know if an image successfully loads and then place it in a bool state using Riverpod?</p>
  <p>Right now I have this code that looks like this:</p>
  <pre><code>final validPhotoProvider = StateProvider&lt;bool&gt;((ref) =&gt; false);
  
  Image.network(
     photoUrl, 
     loadingBuilder: (context, child, loadingProgress){
        if(loadingProgress == null){ //means image has finished loading.
          ref.read(validPhotoProvider).state = true;
          return child;
        }
        return CircularProgressIndicator();
     },
  ),
  </code></pre>
  <p>As you can see I am relying on the builder to know if the image was loaded. Is there a better way to do this as I know this kind of  method is not good as it may result in a bad state eventually.</p>