title: Save network images in Flutter to load them offline
body: <p>How can I make a network image being available offline in my app? So, when I don't have network, it can be loaded from cache next time.</p>
  
  <p>I'd tried <code>network_to_file_image</code> package and <code>cache network image</code> package as well, but it didn't work for me.</p>
  
  <p>When I used cached network and I opened the app next time (without network) the images didn't load again from cache memory.</p>
  
  <p>Here is the code where I use network image package in my Flutter app:</p>
  
  <pre><code>CarouselSlider(
            enlargeCenterPage: true,
            autoPlay: true,
            height: 350,
            initialPage: 0,
            items: keyPlans.map((key) {
              File file;
              getData() {
                DirServices().file("loacliamge_${counter++}").then((File data) {
                  file = data;
                });
                return file;
              }
  
              return new CarousalCard(
                image: NetworkToFileImage(file: getData(), url: key, debug: true),
                onPressed: () {
                  setState(() {
                    Navigator.push(
                        context,
                        MaterialPageRoute(
                            builder: (context) =&gt; ImageView(
                                  image: CachedNetworkImageProvider(key),
                                  text: appTitle,
                                )));
                  });
                },
              );
            }).toList());
  </code></pre>
  
  <p><code>network_to_file_image</code> package always fetch data from the network.</p>