Use case
I recently stumbled across the class OperatingSystemUtils in flutter_tools.
I noticed that the implementation of hostPlatform differs from platform to platform.
E.g. Windows uses Abi.current to determine its architecture variants, whereas all others use their custom implementation.
Wouldn't it make sense for all to use Abi.current.
See:
|
HostPlatform get hostPlatform; |
One reason I can think about it is not done on purpose, because the platform (TARGET) Dart runs on can differ from actual machine platform (HOST), e.g. when cross-platform building. But then Windows should use its own implementation without using
Abi.current.
I am no expert there, I just want to be sure. Maybe Abi.current also reflects the real host (?), but I think it doesn't.
Therefore it would be good to have documented, what OperatingSystemUtils and OperatingSystemUtils.hostPlatform is representing and for what it can be used.
Proposal
I would like to propose to document the usage of this class properly and in a second step, if feasable, replace the implementation with Darts built-in Abi.current implementation on all platforms.
See commit: dd69590
Use case
I recently stumbled across the class
OperatingSystemUtilsin flutter_tools.I noticed that the implementation of
hostPlatformdiffers from platform to platform.E.g. Windows uses
Abi.currentto determine its architecture variants, whereas all others use their custom implementation.Wouldn't it make sense for all to use
Abi.current.See:
flutter/packages/flutter_tools/lib/src/base/os.dart
Line 135 in a647115
One reason I can think about it is not done on purpose, because the platform (TARGET) Dart runs on can differ from actual machine platform (HOST), e.g. when cross-platform building. But then Windows should use its own implementation without using
Abi.current.I am no expert there, I just want to be sure. Maybe
Abi.currentalso reflects the real host (?), but I think it doesn't.Therefore it would be good to have documented, what
OperatingSystemUtilsandOperatingSystemUtils.hostPlatformis representing and for what it can be used.Proposal
I would like to propose to document the usage of this class properly and in a second step, if feasable, replace the implementation with Darts built-in
Abi.currentimplementation on all platforms.See commit: dd69590