Skip to content
pubscout

simple_platform

1.0.1, released 3 years ago by an unverified publisher

Determine application and device platforms separately in Flutter.

WASM-ready
$ flutter pub add simple_platform
Source repository

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.