Platform class Utility

Provides utility methods for detecting the current platform.

Constructors

Platform()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

getPlatform() → String
Returns the platform identifier string (e.g. "web", "ios", "windows", "macos", "linux").
isDesktop() → bool
Returns true if running on a desktop platform (Windows, macOS, or Linux).
isIOS() → bool
Returns true if the current platform is iOS.
isLinux() → bool
Returns true if the current platform is Linux.
isMacOS() → bool
Returns true if the current platform is macOS.
isWeb() → bool
Returns true if running in a web browser.
isWindows() → bool
Returns true if the current platform is Windows.