Line data Source code
1 : // ignore_for_file: public_member_api_docs 2 : 3 : import 'platform_web.dart' if (dart.library.io) 'platform_io.dart'; 4 : 5 : abstract class Platform { 6 0 : static bool get isWeb => currentPlatform == PlatformType.web; 7 : 8 0 : static bool get isMacOS => currentPlatform == PlatformType.macOS; 9 : 10 0 : static bool get isWindows => currentPlatform == PlatformType.windows; 11 : 12 0 : static bool get isLinux => currentPlatform == PlatformType.linux; 13 : 14 6 : static bool get isAndroid => currentPlatform == PlatformType.android; 15 : 16 0 : static bool get isIOS => currentPlatform == PlatformType.iOS; 17 : 18 0 : static bool get isFuchsia => currentPlatform == PlatformType.fuchsia; 19 : } 20 : 21 10 : enum PlatformType { web, windows, linux, macOS, android, fuchsia, iOS }