Platform class final

Platform info Works on the web, mobile phones, desktops and console. Provides platform information such as:

  • Build mode

    • release (release build mode)
    • profile (profile build mode)
    • debug (debug build mode)
  • Host platform type

    • io (desktops, mobile, console)
    • web (browser)
  • Operation system

    • Fuchsia
    • Linux
    • MacOS
    • Windows
    • iOS
    • Android
    • Unknown
  • Version

  • Locale string

  • The number of individual execution units of the machine.

  • Operating system is known type

  • Is mobile device (Android, iOS)

  • Is desktop device (Windows, MacOS, Fuchsia)

  • Is material (Android, Fuchsia)

  • Is cupertino (MacOS, iOS)

Implementers
Annotations
  • @immutable

Properties

buildMode BuildMode
Build mode
final
hashCode int
The hash code for this object.
no setteroverride
isAndroid bool
Whether the operating system is a version of Android
no setter
isCupertino bool
Is cupertino (MacOS, iOS)
final
isDesktop bool
Is desktop device (Windows, MacOS, Fuchsia)
final
isFuchsia bool
Whether the operating system is a version of Fuchsia
no setter
isIO bool
Is I/O supporting for non-web applications
no setter
isIOS bool
Whether the operating system is a version of iOS
no setter
isLinux bool
Whether the operating system is a version of Linux
no setter
isMacOS bool
Whether the operating system is a version of macOS
no setter
isMaterial bool
Is material (Android, Fuchsia)
final
isMobile bool
Is mobile device (Android, iOS)
final
isOperatingSystemKnown bool
Operating system is known type
final
isWeb bool
Is web-based applications
no setter
isWindows bool
Whether the operating system is a version of Microsoft Windows.
no setter
locale String
Locale string
no setter
numberOfProcessors int
The number of individual execution units of the machine Returns 0 if unknown or not available Use .clamp(1, double.infinity) if you need a quantity greater than 0
no setter
operatingSystem OperatingSystem
Operation system
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type HostPlatformType
Host platform type
no setter
version String
Version in i/o - operating system version in Web - user agent string
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
when<PlatformResult>({PlatformResult fuchsia()?, PlatformResult windows()?, PlatformResult android()?, PlatformResult iOS()?, PlatformResult macOS()?, PlatformResult linux()?, PlatformResult unknown()?, PlatformResult material()?, PlatformResult cupertino()?, PlatformResult mobile()?, PlatformResult desktop()?, PlatformResult io()?, PlatformResult web()?, PlatformResult release()?, PlatformResult profile()?, PlatformResult debug()?, PlatformResult orElse()?}) → PlatformResult?
Run functions that satisfy the current state of the platform. You can use nested methods to compose more complex queries. Can return null, if orElse not set and any callback was not called.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Properties

I Platform
Short form to access the instance of Platform
no setter
instance Platform
Access to the Singleton instance of Platform
no setter