Skip to content

Split API into cross-platform OS-detection and native-only Platform i… #2

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lrhn
Copy link
Owner

@lrhn lrhn commented Sep 8, 2023

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.

lrhn and others added 3 commits September 8, 2023 18:57
…nquiry.

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.
Create migration-guide.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants