title: How to get frameBuilder and loadingBuilder to work togerther in Image.network?
body: <p>How to get frameBuilder and loadingBuilder to work togerther ?</p>
  <p>&quot;loadingBuilder&quot; works all the time (with or without frameBuilder) but &quot;frameBuilder&quot; works only if it is alone (i.e. commenting loadingBuilder out).</p>
  <p>The documentation talks about &quot;chaining&quot; frameBuilder with loadingBuilder, it's not obvious that is something happens internally or it is something we have to consider.</p>
  <pre><code>Image.network(_imageUrl,
      height: 400,
      width: MediaQuery.of(context).size.width,
      fit: BoxFit.fitWidth,
  
      frameBuilder: (BuildContext context, Widget child, int frame, bool wasSynchronouslyLoaded) {
          if (wasSynchronouslyLoaded) return child;
          return AnimatedOpacity(
                  opacity: frame == null ? 0 : 1,
                  duration: Duration(seconds: 5),
                  curve: Curves.easeOut,
                  child: child,
              );
      },
  
      loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent loadingProgress) {
          if (loadingProgress == null) return child;
          return Center(
              child: CircularProgressIndicator(
                          value: loadingProgress.expectedTotalBytes != null ?
                          loadingProgress.cumulativeBytesLoaded / loadingProgress.expectedTotalBytes :
                          null,
                      ),
                  );
      },
  
      errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
          return Text('Failed to load image');
      },
  ),
  </code></pre>
  <h2>Edit:</h2>
  <h2>What Happens Exactly:</h2>
  <p>Case 1: When loadingBuilder is ALONE the CircularProgressIndicator is showing and the loading process is completed then the indicator disappears and the loaded image is showing without fading. (Perfect)</p>
  <p>Case 2: When frameBuilder is ALONE the image takes its time to load (of cource there is the indicator), then the loaded image is showing gradually as expected. (Perfect)</p>
  <p>Case 3: When the frameBuilder and loadingBuilder BOTH are enabled, what happened is CASE 1 exactly without any fading of the image. (Wrong)</p>
  <h2>Expected Behavior:</h2>
  <p>The indicator is shown while the loading process is going, then disappear and the image is shown with fading effect.</p>
  <p>I need to fix this code and figure out where is the problem.</p>