platform_plus 1.1.1 copy "platform_plus: ^1.1.1" to clipboard
platform_plus: ^1.1.1 copied to clipboard

Platform Plus is a package for easily figuring out information about the platform your code is running on

platform_plus #

Platform Plus is a package for easily figuring out information about the platform your code is running on.

Since dart:io is unavailable in web apps and dart:js is unavailable in native apps, the only way to do platform checks is with a conditional import like this:

import 'package:platform_plus/platform_mobile.dart'
    if (dart.library.js) 'package:platform_plus/platform_web.dart';

That gets really annoying so this package handles it for you.

Getting Started #

import 'package:platform_plus/platform_plus.dart';

platform.isAndroidNative;
platform.isAndroidWeb;
// And every other combination

await platform.isPhysicalDevice();
13
likes
150
pub points
82%
popularity

Publisher

verified publisherrexios.dev

Platform Plus is a package for easily figuring out information about the platform your code is running on

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

browser_detector, device_info_plus, flutter

More

Packages that depend on platform_plus