You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that HttpDate is coming from dart:io and helps convert a DateTime string according to RFC 1123.
Run the flutter application (from web_app):
flutter run -d chrome
It succeeds, proving the documentation statement to be incorrect.
Build the flutter application (from web_app):
flutter build web
It succeeds, proving the documentation statement to be incorrect.
Expected fix
The notice is updated to be more accurate and outlines what specific parts of dart:io are not Web compatible.
Additional context
I'm personally not able to enumerate all the parts of dart:io that are not Web compatible. If those are provided I wouldn't mind updating the documentation.
At least, the documentation does end with a recommendation to use package:http that will cater for some cases, but that's not a justification to provide incorrect statements highlighted as important.
You should avoid directly using dart:io to make HTTP requests. The HttpClient class in dart:io is platform-dependent and tied to a single implementation. Instead, use a higher-level library like package:http.
I would like to fix this problem.
I will try and fix this problem on dart.dev.
The text was updated successfully, but these errors were encountered:
Page URL
https://dart.dev/libraries/dart-io
Page source
https://github.com/dart-lang/site-www/blob/main/src/content/libraries/dart-io.md
Describe the problem
Currently the
dart:io
documentation states:However, I believe this is not entirely true, consider the following reproductive steps:
Importing and using
dart:io
in a Flutter web applcationdart:io
at the start of themain.dart
file at the start of the file:Note that
HttpDate
is coming fromdart:io
and helps convert a DateTime string according to RFC 1123.It succeeds, proving the documentation statement to be incorrect.
It succeeds, proving the documentation statement to be incorrect.
Expected fix
The notice is updated to be more accurate and outlines what specific parts of
dart:io
are not Web compatible.Additional context
I'm personally not able to enumerate all the parts of
dart:io
that are not Web compatible. If those are provided I wouldn't mind updating the documentation.At least, the documentation does end with a recommendation to use
package:http
that will cater for some cases, but that's not a justification to provide incorrect statements highlighted as important.I would like to fix this problem.
The text was updated successfully, but these errors were encountered: