Platform class Null safety

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.
read-only
currentHost Platforms
The application's host operating system. In the example of running Flutter web on an iPhone, the host would be iOS.
read-only
hashCode int
The hash code for this object.
read-onlyinherited
isAndroid bool
read-only
isCanvasKit bool
read-only
isChromeExtension bool
read-only
isFuschia bool
read-only
isHtml bool
read-only
isIOS bool
read-only
isLinux bool
read-only
isMacOS bool
read-only
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.
read-only
isWeb bool
read-only
isWindows bool
read-only
override Platforms?
read / write
overrideHost Platforms?
read / write
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
supportedPlatforms Set<Platforms>
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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
read-only

Static Methods

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