title: Flutter How to save list of data to local Storage
body: <p>I am developing movie discovering app on flutter and I need to save the list of now playing movies on local storage for offline use and so how can I do that
      Future> getNowPlayingMovies() async {
      final String nowPlaying =
          '<a href="https://api.themoviedb.org/3/tv/airing_today?api_key=" rel="nofollow noreferrer">https://api.themoviedb.org/3/tv/airing_today?api_key=</a>' +
              '$myapikey' +
              '&amp;page=' +
              '1';</p>
  
  <pre><code>var httpClient = new HttpClient();
  try {
    // Make the call
    var request = await httpClient.getUrl(Uri.parse(nowPlaying));
    var response = await request.close();
    if (response.statusCode == HttpStatus.OK) {
      var jsonResponse = await response.transform(utf8.decoder).join();
      // Decode the json response
      var data = jsonDecode(jsonResponse);
      // Get the result list
      List results = data["results"];
      print(results);
      // Get the Movie list
      List&lt;moviemodel&gt; movieList = createNowPlayingMovieList(results);
      // Print the results.
      return movieList;
    } else {
      print("Failed http call.");
    }
  } catch (exception) {
    print(exception.toString());
  }
  return null;}
  
  
  
    List&lt;moviemodel&gt; createNowPlayingMovieList(List data) {
  List&lt;Searchmodel&gt; list = new List();
  for (int i = 0; i &lt; data.length; i++) {
    var id = data[i]["id"];
    String title = data[i]["name"];
    String posterPath = data[i]["poster_path"];
    String mediatype = data[i]["media_type"];
  
    moviemodel movie = new moviemodel(id, title, posterPath, mediatype);
    list.add(movie);
  }
  return list; }
  
  
  
  List&lt;Widget&gt; createNowPlayingMovieCardItem(
    List&lt;moviemodel&gt; movies, BuildContext context) {
  // Children list for the list.
  List&lt;Widget&gt; listElementWidgetList = new List&lt;Widget&gt;();
  if (movies != null) {
    var lengthOfList = movies.length;
    for (int i = 0; i &lt; lengthOfList; i++) {
      Searchmodel movie = movies[i];
      // Image URL
      var imageURL = "https://image.tmdb.org/t/p/w500/" + movie.posterPath;
      // List item created with an image of the poster
      var listItem = new Padding(
        padding: const EdgeInsets.all(8.0),
        child: new Container(
          width: 105.0,
          height: 155.0,
          child: new Column(
            children: &lt;Widget&gt;[
              new GestureDetector(
                onTap: () {
                  Navigator.push(
                    context,
                    new MaterialPageRoute(
                        builder: (_) =&gt; new Detail(movie.id)),
                  );
                },
                child: new Container(
                  width: 105.0,
                  height: 155.0,
                  child: new ClipRRect(
                    borderRadius: new BorderRadius.circular(7.0),
                    child: new Hero(
                      tag: movie.title,
                      child: new FadeInImage.memoryNetwork(
                        placeholder: kTransparentImage,
                        image: imageURL,
                        fit: BoxFit.cover,
                      ),
                    ),
                  ),
                  decoration: new BoxDecoration(boxShadow: [
                    new BoxShadow(
                        color: Colors.black12,
                        blurRadius: 10.0,
                        offset: new Offset(0.0, 10.0)),
                  ]),
                ),
              ),
              new Padding(
                padding: const EdgeInsets.only(top: 18.0),
                child: new Text(
                  movie.title,
                  maxLines: 2,
                ),
              )
            ],
          ),
        ),
      );
      ;
      listElementWidgetList.add(listItem);
    }
  } else {
    print("no movie search");
  }
  return listElementWidgetList;}
  </code></pre>
  
  <p>thank you!</p>