platformx 1.1.0 copy "platformx: ^1.1.0" to clipboard
platformx: ^1.1.0 copied to clipboard

Lightweight platform checking utility for Flutter. Works for all platforms.

PlatformX #

pub package

A multi-platform lightweight tool which helps you check the platform your app is running on.

Android Web

  • Usage #

There are 2 ways to use it.

First way : #

PlatformX.platform
copied to clipboard

This will return one of the values of the PlatformEnum enum.

enum PlatformEnum {
  Android,
  IOS,
  Web,
  Windows,
  Linux,
  MacOS,
  Fuchsia,
}
copied to clipboard

Second way : #

PlatformX.is[Android/IOS/Web/Windows/Linux/MacOS/Fuchsia]
copied to clipboard

Example:

PlatformX.isLinux
copied to clipboard

This will return true if you are running on that specific platform, or false otherwise.

License #

MIT

5
likes
160
points
108
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.22 - 2025.04.06

Lightweight platform checking utility for Flutter. Works for all platforms.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on platformx