-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Add web safe indirection to Platform.isPlatform getters #33406
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
Add web safe indirection to Platform.isPlatform getters #33406
Conversation
|
It would be nice if these were const values instead of accessors, a la dart-lang/sdk#35705. Then the code could be more completely optimized by the compiler. But at least these are accessors and not functions so that they can be swapped out for const values in the future. |
|
We could definitely do this ourselves once a) the const evaluation update lands, allowing us to provide defines to non-AOT builds b) we produce different bundles/snapshots per architecture |
justinmc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Looks like you'll need to merge with master.
goderbauer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…)" This reverts commit d92b3b4.
Description
flutter tests compiled to JavaScript will not be able to safely invoke
Platform.isWindows/isLinux/isMacOSin skip fields since thisdart:iomethod has no implementation currently in the web SDK. Even if we added an implementation, it would likely not capture the spirit of these particular skips - we don't want to conflate skipping something on flutter tester on Windows with skipping something running in a browser on Windows.To avoid the lint "don't define a class with only static members" I made these top level getters, though I am open to other approaches.
Related Issues
#33349