diff --git a/core/lib/utils/platform_info.dart b/core/lib/utils/platform_info.dart index 6978807b3..adebd0cad 100644 --- a/core/lib/utils/platform_info.dart +++ b/core/lib/utils/platform_info.dart @@ -1,17 +1,15 @@ -import 'dart:io'; - import 'package:core/utils/app_logger.dart'; import 'package:core/utils/web_renderer/canvas_kit.dart'; import 'package:flutter/foundation.dart'; abstract class PlatformInfo { static const bool isWeb = kIsWeb; - static bool get isLinux => !kIsWeb && Platform.isLinux; - static bool get isWindows => !kIsWeb && Platform.isWindows; - static bool get isMacOS => !kIsWeb && Platform.isMacOS; - static bool get isFuchsia => !kIsWeb && Platform.isFuchsia; - static bool get isIOS => !kIsWeb && Platform.isIOS; - static bool get isAndroid => !kIsWeb && Platform.isAndroid; + static bool get isLinux => !kIsWeb && defaultTargetPlatform == TargetPlatform.linux; + static bool get isWindows => !kIsWeb && defaultTargetPlatform == TargetPlatform.windows; + static bool get isMacOS => !kIsWeb && defaultTargetPlatform == TargetPlatform.macOS; + static bool get isFuchsia => !kIsWeb && defaultTargetPlatform == TargetPlatform.fuchsia; + static bool get isIOS => !kIsWeb && defaultTargetPlatform == TargetPlatform.iOS; + static bool get isAndroid => !kIsWeb && defaultTargetPlatform == TargetPlatform.android; static bool get isMobile => isAndroid || isIOS; static bool get isDesktop => isLinux || isWindows || isMacOS; static bool get isCanvasKit => isRendererCanvasKit;