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
desktopBreakpoint int
final
hashCode int
The hash code for this object.
no setterinherited
isAndroid bool
no setter
isCanvasKit bool
no setter
isChromeExtension bool
no setter
isDesktop bool
Whether the current screen width determined by a MediaQuery check against the NavigatorState.currentContext supplied as the Platform.navigatorKey is greater than or equal to the Platform.desktopBreakpoint.
no setter
isFormFactorEnabled bool
no setter
isFuschia bool
no setter
isHtml bool
no setter
isIOS bool
no setter
isLinux bool
no setter
isMacOS bool
no setter
isMobile bool
Whether the current screen width determined by a MediaQuery check against the NavigatorState.currentContext supplied as the Platform.navigatorKey. is less than the Platform.desktopBreakpoint.
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
isTestOverride bool
getter/setter pair
isWeb bool
no setter
isWindows bool
no setter
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportedPlatforms List<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({int? desktopBreakpoint, GlobalKey<NavigatorState>? navigatorKey, List<Platforms>? supportedPlatforms}) → dynamic