| 1234567891011121314151617181920212223242526 |
- import 'dart:io';
- /// 平台判断工具类
- class PlatformUtil {
- PlatformUtil._();
- static bool get isMacOS => Platform.isMacOS;
- static bool get isWindows => Platform.isWindows;
- static bool get isLinux => Platform.isLinux;
- static bool get isAndroid => Platform.isAndroid;
- static bool get isIOS => Platform.isIOS;
- /// 切换注释,就可以用来测试iOS平台的效果
- // static bool get isIOS => true;
- static bool get isFuchsia => Platform.isFuchsia;
- static bool get isMobile => Platform.isIOS || Platform.isAndroid;
- static bool get isDesktop =>
- PlatformUtil.isMacOS || PlatformUtil.isWindows || PlatformUtil.isLinux;
- }
|