title: How to playback an .mp3 file in a Flutter app?
body: <p>I have written a <em>Dart</em> web app that retrieves .mp3 files from a server and plays them back; I am trying to write a mobile version using Flutter. I know <code>dart:web_audio</code> is the main option for a web app, but Flutter can't find it in my SDK. I know it's there because I can compile the following to Javascript:</p>
  
  <pre class="lang-js prettyprint-override"><code>import 'dart:html';
  import 'dart:convert';
  import 'dart:web_audio';
  AudioContext audioContext;
  
  main() async {
    audioContext = new AudioContext();
    var ul = (querySelector('#songs') as UListElement);
    var signal = await HttpRequest.getString('http://10.0.0.6:8000/api/filelist');
   //  Map json = JSON.decode(signal);
   //  for (Map file in json['songs']) {
     print("signal: $signal");
     Map json = JSON.decode(signal);
     for (Map file in json['songs']) {
       var li = new LIElement()
         ..appendText(file['title']);
       var button = new ButtonElement();
       button.setAttribute("id", "#${file['file']}");
       button.appendText("Play");
  
       li.append(button);
       new Song(button, file['file']);
       ul.append(li);
  
    }
  
  }
  
  class Song {
    ButtonElement button;
    bool _playing = false;
    // AudioContext _audioContext;
    AudioBufferSourceNode _source;
    String title;
  
    Song(this.button, this.title) {
  
      button..onClick.listen((e) =&gt; _toggle());
    }
  
    _toggle() {
      _playing = !_playing;
      _playing ? _start() : _stop();
    }
  
    _start() {
      return HttpRequest
           .request("http://10.0.0.6:8000/music/$title", responseType: "arraybuffer")
           .then((HttpRequest httpRequest) {
              return audioContext
                .decodeAudioData(httpRequest.response)
           .then((AudioBuffer buffer) {
                _source = audioContext.createBufferSource();
                _source.buffer = buffer;
                _source.connectNode(audioContext.destination);
                _source.start(0);
                button.text = "Stop";
                _source.onEnded.listen((e){
                   _playing = false;
                   button.text = "Play";
            });
         });
      });
    }
  
    _stop() {
       _source.stop(0);
       button.text = "Play";
    }
  } 
  </code></pre>
  
  <p>How would I rewrite the <code>dart:web_audio</code> parts of my code for a Flutter app? Can Flutter access MediaPlayer? And if so, how would I refer to it in <code>pubspec.yaml</code>?</p>