PrismUpdatePlatformInfo.detect constructor

PrismUpdatePlatformInfo.detect()

Detects the current platform from defaultTargetPlatform.

Implementation

factory PrismUpdatePlatformInfo.detect() {
  final target = defaultTargetPlatform;
  return PrismUpdatePlatformInfo(
    isWeb: kIsWeb,
    isAndroid: !kIsWeb && target == TargetPlatform.android,
    isIOS: !kIsWeb && target == TargetPlatform.iOS,
    isWindows: !kIsWeb && target == TargetPlatform.windows,
    isMacOS: !kIsWeb && target == TargetPlatform.macOS,
    isLinux: !kIsWeb && target == TargetPlatform.linux,
  );
}