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.
📱 Platform Type
Checks if the application is running on a mobile OS (Android or iOS).if (context.isMobile) { ... }
Checks if the application is running on a desktop OS (Windows, Linux, or macOS).if (context.isDesktop) {
// Use a wider, more complex sidebar layout
}
🍎 Specific Operating System
Checks if the application is running on an iOS device.if (context.isIOS) { ... }
Checks if the application is running on an Android device.if (context.isAndroid) { ... }
Checks if the application is running on a macOS desktop environment.if (context.isMacOS) { ... }
Checks if the application is running on a Windows desktop environment.if (context.isWindows) { ... }
Checks if the application is running on a Linux desktop environment.if (context.isLinux) { ... }
Checks if the application is running on the experimental Fuchsia OS.if (context.isFuchsia) { ... }