I am running a flutter basic application via Google Chrome that has one button This button when pressed calls an api that make a get request
consumeLogin() async {
HttpClientRequest request = await new HttpClient().getUrl(url);
print(request);
HttpClientResponse response = await request.close();
Stream repStream = response.transform(utf8.decoder);
await for (var data in repStream) {
print(data);
}
}
When I inspect the console I have this error
Uncaught (in promise) Error: Unsupported operation: Platform._version
at Object.throw_ [as throw] (errors.dart:216)
at Function._version (io_patch.dart:286)
at Function.get version [as version] (platform_impl.dart:123)
at get _version (platform.dart:76)
at Function.desc.get [as _version] (operations.dart:816)
at Function.get version [as version] (platform.dart:233)
at Object._getHttpVersion (http_impl.dart:3371)
at new _http._HttpClient.new (http_impl.dart:2154)
at Function.new (http.dart:1517)
at home_page.HomePage.new.consumeLogin (home_page.dart:81)
at consumeLogin.next (<anonymous>)
at runBody (async_patch.dart:86)
at Object._async [as async] (async_patch.dart:125)
at home_page.HomePage.new.consumeLogin (home_page.dart:79)
at ink_well.InkWell.new.<anonymous> (home_page.dart:67)
at _InkResponseState.new.[_handleTap] (ink_well.dart:772)
at ink_well.dart:855
at tap.TapGestureRecognizer.new.invokeCallback (recognizer.dart:182)
at tap.TapGestureRecognizer.new.handleTapUp (tap.dart:522)
at tap.TapGestureRecognizer.new.[_checkUp] (tap.dart:282)
at tap.TapGestureRecognizer.new.acceptGesture (tap.dart:254)
at arena.GestureArenaManager.new.sweep (arena.dart:156)
at binding$5.WidgetsFlutterBinding.new.handleEvent (binding.dart:222)
at binding$5.WidgetsFlutterBinding.new.dispatchEvent (binding.dart:198)
What is happening?