diff --git a/pkgs/http/lib/src/browser_client.dart b/pkgs/http/lib/src/browser_client.dart index 84f79e0538..10d8e0cdba 100644 --- a/pkgs/http/lib/src/browser_client.dart +++ b/pkgs/http/lib/src/browser_client.dart @@ -4,7 +4,6 @@ import 'dart:async'; import 'dart:js_interop'; -import 'dart:typed_data'; import 'package:web/helpers.dart'; @@ -79,7 +78,7 @@ class BrowserClient extends BaseClient { )); return; } - var body = (xhr.response as ByteBuffer).asUint8List(); + var body = (xhr.response as JSArrayBuffer).toDart.asUint8List(); completer.complete(StreamedResponse( ByteStream.fromBytes(body), xhr.status, contentLength: body.length,