Remove fetch.dart (#3584)

These uses cases are now address by http.dart via http.readDataPipe.
This commit is contained in:
Adam Barth
2016-04-27 13:09:37 -07:00
parent 256adfcd46
commit 7ef1df4d5b
7 changed files with 63 additions and 67 deletions

View File

@@ -4,11 +4,11 @@
import 'dart:async';
import 'package:mojo/mojo/url_response.mojom.dart';
import 'package:sky_services/media/media.mojom.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:flutter/http.dart' as http;
// All of these sounds are marked as public domain at soundbible.
const String chimes = "http://soundbible.com/grab.php?id=2030&type=wav";
@@ -42,8 +42,7 @@ class PianoKey {
Future<Null> load(MediaServiceProxy mediaService) async {
try {
mediaService.ptr.createPlayer(player);
UrlResponse response = await fetchUrl(soundUrl);
await player.ptr.prepare(response.body);
await player.ptr.prepare(await http.readDataPipe(soundUrl));
} catch (e) {
print("Error: failed to load sound file $soundUrl");
player.close();