title: how to add cached image to app bar in flutter (using cached_image_network)
body: <pre><code>return Scaffold(
        appBar: AppBar(title: CachedNetworkImage(imageUrl: "https://cdn.pixabay.com/photo/2016/02/24/19/05/apples-1220574__340.png",
          width: 80.0,
          height: 80.0,
  
  
      )),
  </code></pre>
  
  <p>I used cached network image to add image in flutter app bar but it is not working please help</p>
  
  <p>here is the console error </p>
  
  <pre><code>Compiler message:
  ../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/cached_network_image-1.1.2+1/lib/src/scaled_file_image.dart:45:24: Error: The method 'ScaledFileImage.load' has fewer positional arguments than those of overridden method 'ImageProvider.load'.
    ImageStreamCompleter load(ScaledFileImage key) {
                         ^
  ../../Flutter/packages/flutter/lib/src/painting/image_provider.dart:403:24: Context: This is the overridden method ('load').
    ImageStreamCompleter load(T key, DecoderCallback decode);
                         ^
  ../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/cached_network_image-1.1.2+1/lib/src/cached_network_image_provider.dart:53:24: Error: The method 'CachedNetworkImageProvider.load' has fewer positional arguments than those of overridden method 'ImageProvider.load'.
    ImageStreamCompleter load(CachedNetworkImageProvider key) {
                         ^
  ../../Flutter/packages/flutter/lib/src/painting/image_provider.dart:403:24: Context: This is the overridden method ('load').
    ImageStreamCompleter load(T key, DecoderCallback decode);
                         ^
  Exception: Errors during snapshot creation: null
  #0      KernelSnapshot.build (package:flutter_tools/src/build_system/targets/dart.dart:230:7)
  &lt;asynchronous suspension&gt;
  #1      _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:526:25)
  &lt;asynchronous suspension&gt;
  #2      _BuildInstance.invokeTarget.&lt;anonymous closure&gt; (package:flutter_tools/src/build_system/build_system.dart:481:35)
  #3      new Future.sync (dart:async/future.dart:222:31)
  #4      AsyncMemoizer.runOnce (package:async/src/async_memoizer.dart:43:45)
  #5      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:481:21)
  &lt;asynchronous suspension&gt;
  &lt;asynchronous suspension&gt;
  #6      BuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:419:36)
  #7      _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:43:6)
  #8      BuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:400:28)
  #9      buildWithAssemble (package:flutter_tools/src/bundle.dart:125:48)
  #10     _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:43:6)
  #11     buildWithAssemble (package:flutter_tools/src/bundle.dart:99:31)
  #12     BundleBuilder.build (package:flutter_tools/src/bundle.dart:75:11)
  #13     _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:43:6)
  #14     BundleBuilder.build (package:flutter_tools/src/bundle.dart:52:21)
  #15     BuildBundleCommand.runCommand (package:flutter_tools/src/commands/build_bundle.dart:126:25)
  #16     _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:43:6)
  #17     BuildBundleCommand.runCommand (package:flutter_tools/src/commands/build_bundle.dart:97:42)
  #18     FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:557:18)
  #19     _asyncThenWrapperHelper.&lt;anonymous closure&gt; (dart:async-patch/async_patch.dart:71:64)
  #20     _rootRunUnary (dart:async/zone.dart:1132:38)
  #21     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
  #22     _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
  #23     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
  #24     Future._propagateToListeners (dart:async/future_impl.dart:707:32)
  #25     Future._completeWithValue (dart:async/future_impl.dart:522:5)
  #26     Future._asyncComplete.&lt;anonymous closure&gt; (dart:async/future_impl.dart:552:7)
  #27     _rootRun (dart:async/zone.dart:1124:13)
  #28     _CustomZone.run (dart:async/zone.dart:1021:19)
  #29     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
  #30     _CustomZone.bindCallbackGuarded.&lt;anonymous closure&gt; (dart:async/zone.dart:963:23)
  #31     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
  #32     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
  #33     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
  #34     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)
  
  Failed to build bundle.
  
  FAILURE: Build failed with an exception.
  
  * Where:
  Script 'C:\Users\user\Flutter\packages\flutter_tools\gradle\flutter.gradle' line: 794
  
  * What went wrong:
  Execution failed for task ':app:compileFlutterBuildDebugArm'.
  &gt; Process 'command 'C:\Users\user\Flutter\bin\flutter.bat'' finished with non-zero exit value 1
  
  
  
  </code></pre>
  
  <p>Please help me find a solution to this.I want to add cached network image to my app. Do you have any better solution???</p>
  
  <p>Please tell me if you want full code I used cached network image to add image in flutter app bar but it is not working please help</p>