platform_info 2.0.0-dev
platform_info: ^2.0.0-dev copied to clipboard
Contains info about current platform such as Build mode and Operating system
platform_info #
About #
Cross-platform io/html package.
Works on the web, mobile phones, desktops and console.
Fully caches itself on first initialization.
Easy to use, just import:
Provides platform information such as:
-
Build mode
- release
- profile
- debug
-
Host platform type
- io (vm, desktops, mobile, console)
- web (html, js, browser)
-
Operating system
- Fuchsia
- Linux
- MacOS
- Windows
- iOS
- Android
- Unknown
-
Version
-
Locale string
-
The number of individual execution units of the machine
-
Operating system is known type
-
Is a mobile device (Android, iOS)
-
Is a desktop device (Windows, macOS, Fuchsia)
-
Is material design device (Android, Fuchsia)
-
Is cupertino design device (macOS, iOS)
-
isLinux
-
isMacOS
-
isWindows
-
isAndroid
-
isIOS
-
isFuchsia
For example: #
import 'package:platform_info/platform_info.dart';
void main(List<String> args) {
// Use [Platform.instance] or [Platform.I] or [platform] getter
print(Platform.instance.numberOfProcessors);
print(Platform.I.operatingSystem);
print(Platform.I.version);
}
Changelog #
Refer to the Changelog to get all release notes.