From 71242888f1a4e2c60d7ec76e00edf9e9036d0f70 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Thu, 26 Jan 2017 12:46:00 -0800 Subject: [PATCH] Revert method generics in `packages/flutter/lib/src/http` (#7662) We converted all code to use method generics in #7235, but we shouldn't have touched the `http` folder since this code is pulled from upstream. --- packages/flutter/lib/src/http/http.dart | 2 +- packages/flutter/lib/src/http/io_client.dart | 2 +- packages/flutter/lib/src/http/utils.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/flutter/lib/src/http/http.dart b/packages/flutter/lib/src/http/http.dart index 870cca1a6a..6806075dd1 100644 --- a/packages/flutter/lib/src/http/http.dart +++ b/packages/flutter/lib/src/http/http.dart @@ -161,7 +161,7 @@ Future read(dynamic url, {Map headers}) => Future readBytes(dynamic url, {Map headers}) => _withClient((Client client) => client.readBytes(url, headers: headers)); -Future _withClient(Future fn(Client client)) async { +Future/**/ _withClient/**/(Future/**/ fn(Client client)) async { Client client = new Client(); try { return await fn(client); diff --git a/packages/flutter/lib/src/http/io_client.dart b/packages/flutter/lib/src/http/io_client.dart index 14f41d4b69..5a3ae79724 100644 --- a/packages/flutter/lib/src/http/io_client.dart +++ b/packages/flutter/lib/src/http/io_client.dart @@ -62,7 +62,7 @@ class IOClient extends BaseClient { }); return new StreamedResponse( - DelegatingStream.typed>(response).handleError((dynamic error) => + DelegatingStream.typed/*>*/(response).handleError((dynamic error) => throw new ClientException(error.message, error.uri), test: (dynamic error) => io.isHttpException(error)), response.statusCode, diff --git a/packages/flutter/lib/src/http/utils.dart b/packages/flutter/lib/src/http/utils.dart index 3ff414a54d..4617269dd0 100644 --- a/packages/flutter/lib/src/http/utils.dart +++ b/packages/flutter/lib/src/http/utils.dart @@ -85,7 +85,7 @@ ByteStream toByteStream(Stream> stream) { /// Calls [onDone] once [stream] (a single-subscription [Stream]) is finished. /// The return value, also a single-subscription [Stream] should be used in /// place of [stream] after calling this method. -Stream onDone(Stream stream, void onDone()) => +Stream/**/ onDone/**/(Stream/**/ stream, void onDone()) => stream.transform(new StreamTransformer.fromHandlers(handleDone: (EventSink sink) { // ignore: always_specify_types sink.close(); onDone();