Skip to main content
Since these getters rely on dart:io.Platform, they will throw an error when compiled for the web. Ensure you only use these methods in mobile and desktop applications.

1

📱 Platform Type

isMobile
bool
Checks if the application is running on a mobile OS (Android or iOS).
if (context.isMobile) { ... }
isDesktop
bool
Checks if the application is running on a desktop OS (Windows, Linux, or macOS).
if (context.isDesktop) {
  // Use a wider, more complex sidebar layout
}
2

🍎 Specific Operating System

isIOS
bool
Checks if the application is running on an iOS device.
if (context.isIOS) { ... }
isAndroid
bool
Checks if the application is running on an Android device.
if (context.isAndroid) { ... }
isMacOS
bool
Checks if the application is running on a macOS desktop environment.
if (context.isMacOS) { ... }
isWindows
bool
Checks if the application is running on a Windows desktop environment.
if (context.isWindows) { ... }
isLinux
bool
Checks if the application is running on a Linux desktop environment.
if (context.isLinux) { ... }
isFuchsia
bool
Checks if the application is running on the experimental Fuchsia OS.
if (context.isFuchsia) { ... }