os library
Provides information about operating system.
The library works in all platforms, including browsers.
The main APIs are:
- environmentalVariables
- Contains environmental variables.
- isRunningInDebugMode
- Is the application running in debug mode?
- isRunningInFlutter
- Is the application running in a Flutter application?
- isRunningInProfileMode
- Is the application running in production mode?
- isRunningInReleaseMode
- Is the application running in production mode?
- isRunningInTest
- Is the application running inside a test?
- isRunningInWeb
- Is the application running in browser?
- OperatingSystemType.current
- In non-browser platforms, returns current operating system type.
- In browsers, uses browser APIs (such as
navigator.userAgent
) to try to determine the underlying operating system.
- OperatingSystemUnsupportedError
- An exception that can be used to signal that operating system is not supported by your code.
- TestEnvironment
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.).