isOnDesktopAndWeb property

bool get isOnDesktopAndWeb

Determines whether the current platform is desktop or web.

Returns true if the platform is web or a desktop platform (macOS, Linux, Windows).

Implementation

bool get isOnDesktopAndWeb {
  if (kIsWeb) {
    return true;
  }
  switch (defaultTargetPlatform) {
    case TargetPlatform.macOS:
    case TargetPlatform.linux:
    case TargetPlatform.windows:
      return true;
    case TargetPlatform.android:
    case TargetPlatform.iOS:
    case TargetPlatform.fuchsia:
      return false;
  }
}