The cross-platform OS detection is in package:platform/host.dart, in the HostPlatform class.
The native-only platform inspection in package:platform/native.dart in the NativePlatform class.
There are also package:platform/host_test.dart, and package:platform/native_test.dart, which provides a mock for each of the platform classes, MockHostPlatform and MockNativePlatform.
Existing code can keep importing package:platform/platform.dart, which exports the host.dart library, but also type-aliases for native-capable platforms to match the existing Platform, FakePlatform and LocalPlatform names. Those legacy names will eventually be deprecated.
The cross-platform OS detection is in
package:platform/host.dart
, in theHostPlatform
class. The native-only platform inspection inpackage:platform/native.dart
in theNativePlatform
class.There are also
package:platform/host_test.dart
, andpackage:platform/native_test.dart
, which provides a mock for each of the platform classes,MockHostPlatform
andMockNativePlatform
.Existing code can keep importing
package:platform/platform.dart
, which exports thehost.dart
library, but also type-aliases for native-capable platforms to match the existingPlatform
,FakePlatform
andLocalPlatform
names. Those legacy names will eventually be deprecated.