os library

Provides information about operating system.

The library works in all platforms, including browsers.

The main APIs are:

Classes

TestEnvironment
A test environment.

Enums

OperatingSystemType
Operating system type.

Constants

isRunningInDebugMode → const bool
Tells whether the code is running in debug mode (assertions enabled).
isRunningInFlutter → const bool
Tells whether the code is running in a Flutter application (any platform, including web).
isRunningInJs → const bool
Tells whether the code is running in a Javascript interpreter.
isRunningInProfileMode → const bool
Tells whether the code is running in debug mode (assertions enabled).
isRunningInReleaseMode → const bool
Tells whether the code is running in debug mode (assertions enabled).
isRunningInWeb → const bool
Tells whether the code is running in a web browser.

Properties

environmentalVariables Map<String, String>
Immutable map of environmental variables.
no setter
isRunningInTest bool
Tells whether the code is running in test.
no setter

Exceptions / Errors

OperatingSystemUnsupportedError
A subclass of UnsupportedError when something is unsupported because of the platform (operating system, CPU, etc.).