-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Platform.isFuchsia #27103
Comments
I believe the main reason for having Platform.isWindows is to allow path computations to use the correct separator. Does Fuchsia need a non-unixy path? |
We use Platform to provide various platform-specific UI adaptations. For example, scrolling physics is different on Android and iOS and will likely be different on Fuchsia again. We use the current Platform to determine which scrolling physics to use. |
That makes sense (but would be better exposed as a I'm not particular happy about an open-ended list of getters for the platforms that we happen to know. It's obvious that the platform If we can remove the old getters too, at a later point, that would be awesome! |
That's what we do, but the UI library is built up in layers. The layer that's hard coded into the Flutter engine binary doesn't know anything about scrolling. That concept is introduced at higher levels in
Yes, that's what we're using today: As written, this code sends the message that Fuchsia is less supported a platform than Android and iOS, which is contrary to the message we want to send.
This seems like an arbitrary point at which to draw this line. For example, if we'd had this discussion a month or so ago, would you have drawn the line at not including iOS? Perhaps a more rational place to draw a line might be at whatever platforms are officially supposed. For example, we wouldn't have a Platform.isBeOS because Dart does not officially support BeOS. |
Yes. It was arbitrary from the very beginning. If I had been asked, I would have drawn the line at the start and not added any member at all. It's pure convenience methods, but they need to be maintained forever, and we have to explain why some platforms are there and others are not - and we don't want to actually add all platforms up front because it requires us to pick a string to represent the platform (and know about the platform). Personally, I'd deprecate every I have similar issues with the path library using |
Because https://github.com/dart-lang/sdk/blob/master/runtime/bin/platform_fuchsia.cc#L35 exists and no corresponding line of code exists for FreeBSD or OpenBSD. |
I don't think we should design our libraries according to which platforms happen to be included in the SDK repository. As this issue shows, that would be a moving target. If another platform decides to have their patches in their own repository, like https://github.com/mulander/openbsd-dart, then the API should work just as well for them. I still lean towards deprecating all the |
I'm less averse to adding a new getter, but there is a high bar for being added. As Lasse mentioned, there isn't even any |
It would be convenient to have a Platform.isFuchsia getter along side Platform.isWindows and such.
The text was updated successfully, but these errors were encountered: