NativePlatform class abstract final

Properties of the native host platform and process.

Provides API parity with the Platform class in dart:io, but using instance properties rather than static properties. This difference enables the use of these APIs in tests, where you can provide mock implementations. Also provides access to a few chosen properties from other parts of dart:io.

Implementers

Properties

environment Map<String, String>
The environment for this process.
no setter
executable String
The file path of the executable used to run the script in this isolate.
no setter
executableArguments List<String>
The flags passed to the executable used to run the script of this program.
no setter
hashCode int
The hash code for this object.
no setterinherited
isAndroid bool
Whether the operating system is Android.
final
isFuchsia bool
Whether the operating system is Fuchsia.
final
isIOS bool
Whether the operating system is iOS.
final
isLinux bool
Whether the operating system is Linux.
final
isMacOS bool
Whether the operating system is OS X.
final
isWindows bool
Whether the operating system is Windows.
final
lineTerminator String
The default line terminator on the current platform.
no setter
localeName String
Get the name of the current locale.
no setter
localHostname String
Get the local hostname for the system.
no setter
numberOfProcessors int
The number of processors of the machine.
no setter
operatingSystem String
A string representing the operating system.
final
operatingSystemVersion String
A string representing the version of the operating system or platform.
final
packageConfig String?
The value of the --packages flag passed to the executable used to run the script in this isolate. This is the configuration which specifies how Dart packages are looked up.
no setter
pathSeparator String
The path separator used by the operating system to separate components in file paths.
no setter
resolvedExecutable String
The path of the executable used to run the script in this isolate after it has been resolved by the OS.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
script Uri
The absolute URI of the script file of the program currently running.
no setter
stdinSupportsAnsi bool
When stdin is connected to a terminal, whether ANSI codes are supported.
no setter
stdoutSupportsAnsi bool
When stdout is connected to a terminal, whether ANSI codes are supported.
no setter
version String
The version of the current Dart runtime.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() String
A JSON representation of the state of this native platform object.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

current NativePlatform?
The current native platform, if any.
no setter

Constants

android → const String
The value of operatingSystem on Android.
fuchsia → const String
The value of operatingSystem on Fuchsia.
iOS → const String
The value of operatingSystem on iOS.
linux → const String
The value of operatingSystem on Linux.
macOS → const String
The value of operatingSystem on macOS.
operatingSystemValues → const List<String>
A list of the known values that operatingSystem can have.
windows → const String
The value of operatingSystem on Windows.