title: How to get List from future list function in Dart
body: <p>I'm creating an app that use assets_audio_player to play music from a json response that are generated from a php script. There is a Future list function that return an Audio list. Audio isn't a Widget so i can't use a FutureBuilder. How can i use the future list?</p>
  <pre><code>    Future&lt;List&lt;Audio&gt;&gt; creaLista() async {
        final response = await http.post(Uri.parse(url));
        String responseBody = response.body;
  
        dynamic jsonObject = json.decode(responseBody);
  
        final convertedJsonObject = jsonObject.cast&lt;Map&lt;String, dynamic&gt;&gt;();
  
        List&lt;Song&gt; list =
            convertedJsonObject.map&lt;Song&gt;((json) =&gt; Song.fromJson(json)).toList();
  
        List&lt;Audio&gt; audioList = list
            .map&lt;Audio&gt;((json) =&gt; Audio.network(
                  urlSong + json.url,
                  metas: Metas(
                    title: json.title,
                    artist: json.artist,
                    album: json.album,
                    image: MetasImage.network(
                      urlImage + json.image,
            ),
          ),
        ))
      .toList();
    
  
      return audioList;
      }
  </code></pre>
  <p>This is the Song class:</p>
  <pre><code>    class Song {
        String title;
        String artist;
        String album;
        String image;
        String genre;
        String url;
      
        Song(
            {required this.title,
            required this.artist,
            required this.album,
            required this.image,
            required this.genre,
            required this.url});
  
        factory Song.fromJson(Map&lt;String, dynamic&gt; json) =&gt; Song(
            title: json['title'],
            artist: json['artist'],
            album: json['album'],
            image: json['image'],
            genre: json['genre'],
            url: json['url']);
      }
  </code></pre>
  <p>This is the json response:</p>
  <pre><code>    [{&quot;title&quot;:&quot;Mille&quot;,&quot;artist&quot;:&quot;Fedez, Achille Lauro, Orietta Berti&quot;,&quot;album&quot;:&quot;Singolo&quot;,&quot;image&quot;:&quot;mille.jpg&quot;,&quot;genre&quot;:&quot;pop&quot;,&quot;url&quot;:&quot;mille.mp3&quot;}]
  </code></pre>