simple_platform
1.0.1, released 3 years ago by an unverified publisher
Determine application and device platforms separately in Flutter.
What it does
Provides AppPlatform and DevicePlatform classes to distinguish between the platform running the app (such as web browsers) and the underlying device platform. Includes handy getter methods and support for test overrides.
AI-written summary of version 1.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to distinguish between the app platform (like web) and the actual device platform.
- You want a test-friendly way to check platforms across all Flutter targets.
Skip it when
- You are already using comprehensive device info libraries that cover platform checks.
Strengths
- Zero external dependencies apart from the Flutter SDK.
- Compiles and runs on all platforms.
- Test friendly with built-in override support.
Weaknesses
- Limited to basic platform checking functionality.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
import 'package:simple_platform/simple_platform.dart';
if (!AppPlatform.isWeb) {
// check app version
}
if (DevicePlatform.isWindows || DevicePlatform.isMacOS || DevicePlatform.isLinux) {
// add desktop features
}Alternatives
Packages that do the same job and could replace simple_platform.
- flutter_esim
Check eSIM support and install eSIM profiles on Android and iOS
44Compare - platform_device_id
Get unique device IDs across Android, iOS, Windows, Linux, macOS, and Web.
50Compare - app_launcher
Launches an installed Android app by its package ID, falling back to Google Play if missing.
46Compare - platform_device_id_plus
Get a unique device identifier across Android, iOS, Windows, macOS, Linux, and Web.
41Compare