Flutter web Http GET throws unwaited function

Viewed 230

I'm running an HTTP get using flutter for the web and after connecting it stops running and directs me to the browser_client.dart file highlighting this function

 unawaited(xhr.onLoad.first.then((_) {
  var body = (xhr.response as ByteBuffer).asUint8List();
  completer.complete(StreamedResponse(
      ByteStream.fromBytes(body), xhr.status!,
      contentLength: body.length,
      request: request,
      headers: xhr.responseHeaders,
      reasonPhrase: xhr.statusText));
}));

then afterward shows this on the debug console

Error: error
    at Object.throw_ [as throw] (http://localhost:53840/dart_sdk.js:5061:11)
at searchListing (http://localhost:53840/packages/maimo/app/data/services/api.dart.lib.js:33:19)
    at searchListing.next (<anonymous>)
    at http://localhost:53840/dart_sdk.js:38640:33
    at _RootZone.runUnary (http://localhost:53840/dart_sdk.js:38511:59)
    at _FutureListener.thenAwait.handleValue (http://localhost:53840/dart_sdk.js:33713:29)
    at handleValueCallback (http://localhost:53840/dart_sdk.js:34265:49)
0 Answers
Related