PlatformUtil class

Web-safe platform detection using Flutter's compile-time target flags.

Prefer these getters over dart:io Platform checks so code works on web.

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 Properties

isAndroid bool
true when running on Android.
no setter
isDesktop bool
true on Windows, macOS, or Linux (desktop targets).
no setter
isFuchsia bool
true when running on Fuchsia.
no setter
isIOS bool
true when running on iOS.
no setter
isLinux bool
true when running on Linux.
no setter
isMacOS bool
true when running on macOS.
no setter
isMobile bool
true on Android or iOS (native mobile targets).
no setter
isWeb bool
true when compiled for web.
no setter
isWindows bool
true when running on Windows.
no setter