Open mnordine opened 6 years ago
CC @terrylucas RE his latest updates to these APIs
Also, response
above should be a Stream
, since it's a ReadableStream
in JS
Analyzer thinks it's dynamic
https://api.dartlang.org/stable/2.2.0/dart-html/Window/fetch.html
I was just testing out
fetch
with DDC (webdev serve
) and noticedresponse.json()
returns a native JS object, when I would think it should return a DartMap
:Output:
NativeJavaScriptObject
An obvious workaround is to
json.decode(await response.text())
A bigger issue I ran into was this throws a runtime error when doing
webdev build
, but it doesn't withwebdev build --no-release
Update: I've filed another issue for the runtime error here: https://github.com/dart-lang/sdk/issues/34924