Skip to content

getting Platform from dart:io throws an exception when running in browser #40558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ali2236 opened this issue Feb 10, 2020 · 1 comment
Closed

Comments

@ali2236
Copy link

ali2236 commented Feb 10, 2020

While it is understandable why it does that, I think that when calling Platform.isAndroid in flutter web, it should just return false.

Another suggestion is to add Platform.isWeb to dart:io instead of using the kIsWeb constant from package:flutter/foundation.dart for checking that dart code is executing in the browser.

@vsmenon
Copy link
Member

vsmenon commented Feb 10, 2020

Merging to #35969

@vsmenon vsmenon closed this as completed Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants