Open dcharkes opened 2 years ago
Can we do anything about duplication between Flutter and Dart?
We have even more duplication.
Current list of alternatives:
Why are Platform.isIOS
not sufficient?
Why are
Platform.isIOS
not sufficient?
If the dart:io owners want this, I'm fine with the implementation.
@lrhn in https://dart-review.googlesource.com/c/sdk/+/275640
@a-siva does anyone dart:io
? @brianquinlan do you own dart:io
?
@brianquinlan do you own dart:io?
Yes.
We have a
Platform.operatingSystem
.However, it's value as
String
does not lend itself well for programmatic use. (E.g. the type will always be String, which is very poor for documentation on functions.)We should consider introducing a type representing an
OS
, a constants for the known values, a constant for all known values, and acurrent
.Design similar to
Abi
indart:ffi
, butAbi
is sealed this isn't.OS
should not be an enum, because if we would ever add an operating system it would break all exhaustive switches.Having
current
as const requires language work:Some open questions:
OS
(orOperatingSystem
) without a non-constcurrent
until we have a way of makingcurrent
const?OS
andPlatform
?@lrhn I tried to summarize what you mentioned earlier. I didn't find an existing tracking issue yet. If we already have one please close this one.