NativePlatformServices class

Native implementation of platform services using dart:io.

Inheritance

Constructors

NativePlatformServices()

Properties

hashCode int
The hash code for this object.
no setterinherited
isNative bool
Whether this is running on a native platform.
no setterinherited
isWeb bool
Whether this is running on a web platform.
no setteroverride
pathSeparator String
Get the platform's path separator.
no setteroverride
printCallback ↔ void Function(String)
Custom print callback. Can be overridden to redirect output.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportsFileSystem bool
Whether file system operations are supported.
no setteroverride
supportsProcess bool
Whether process operations are supported.
no setteroverride

Methods

defaultPrint(String s) → void
Print a string using the default mechanism for this platform.
override
deleteFile(String path) bool
Delete a file at the given path. Returns true if successful, false otherwise.
override
directoryExists(String path) bool
Check if a directory exists at the given path.
override
exit(int code) → Never
Exit the application with the given code. Throws UnsupportedError on platforms that don't support this.
override
fileExists(String path) bool
Check if a file exists at the given path.
override
getEnvironmentVariable(String name) String?
Get an environment variable value. Returns null if not available or not supported on this platform.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
println(String s) → void
Print a string followed by a newline.
inherited
readFileAsBytes(String path) Uint8List?
Read a file as bytes. Returns null if file doesn't exist or reading fails.
override
readFileAsString(String path) String?
Read a file as a string. Returns null if file doesn't exist or reading fails.
override
renameFile(String oldPath, String newPath) bool
Rename a file from oldPath to newPath. Returns true if successful, false otherwise.
override
runProcess(String command, List<String> args) int?
Run a process synchronously. Returns the exit code, or null if not supported.
override
toString() String
A string representation of this object.
inherited

Operators

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