Platform class

A platform utility class that provides helpers for determining the current platform, host platform, renderer and other platform checks.

Properties

current Platforms
The current platform the Flutter application us running on.
no setter
currentHost Platforms
The application's host operating system. In the example of running Flutter web on an iPhone, the host would be iOS.
no setter
hashCode int
The hash code for this object.
no setterinherited
isAndroid bool
no setter
isCanvasKit bool
no setter
isChromeExtension bool
no setter
isFuschia bool
no setter
isHtml bool
no setter
isIOS bool
no setter
isLinux bool
no setter
isMacOS bool
no setter
isNative bool
Whether the application's platform is the same as the host platform. ex.1 If running Flutter web on macOS, the application's platform is web while the host's platform is macOS so it returns false. ex.2 If running Flutter for iOS on an iPhone then the application's platform is iOS and the host's platform is iOS so it returns true.
no setter
isWeb bool
no setter
isWindows bool
no setter
override Platforms?
getter/setter pair
overrideHost Platforms?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportedPlatforms Set<Platforms>
final

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

instance Platform
no setter

Static Methods

init({Set<Platforms>? supportedPlatforms, Platforms? override, Platforms? overrideHost}) → dynamic