better platform check

This commit is contained in:
Hiroshi Horie
2021-12-15 18:44:01 +07:00
parent 3d5e8a7dd8
commit b24fad0f3b
8 changed files with 50 additions and 14 deletions
+15
View File
@@ -0,0 +1,15 @@
import 'platform/io.dart' if (dart.library.html) 'platform/web.dart';
// Returns the current platform which works for both web and devices.
PlatformType lkPlatform() => lkPlatformImplementation();
bool lkPlatformIs(PlatformType type) => lkPlatform() == type;
enum PlatformType {
web,
windows,
linux,
macOS,
android,
fuchsia,
iOS,
}