SystemExtension extension
Extension on InternalSystemContext
that provides access to system-level
and environment-related properties similar to Java's System.getProperties()
and System.getenv()
.
This includes metadata about the Dart runtime, host operating system, environment variables, and more.
Example
final properties = context.getProperties();
print(properties['os.name']); // e.g., 'macos'
final dartVersion = context.getProperty('dart.version');
print(dartVersion); // e.g., '3.3.0'
final env = context.getEnv();
print(env['PATH']);
final home = context.getEnvVar('HOME');
print(home);
Useful in cross-platform utilities, diagnostics, and configuration loading.
- on
-
- _System
Methods
-
getEnv(
) → Map< String, String> -
Available on _System, provided by the SystemExtension extension
Extension onInternalSystemContext
that provides access to system-level and environment-related properties similar to Java'sSystem.getProperties()
andSystem.getenv()
. -
getEnvVar(
String name) → String? -
Available on _System, provided by the SystemExtension extension
Returns the environment variable value for the givenname
, ornull
if not defined. -
getProperties(
) → Map< String, String> -
Available on _System, provided by the SystemExtension extension
Extension onInternalSystemContext
that provides access to system-level and environment-related properties similar to Java'sSystem.getProperties()
andSystem.getenv()
. -
getProperty(
String name) → String? -
Available on _System, provided by the SystemExtension extension
Returns the system property value for the givenname
, ornull
if not found.