toJson method
A JSON-encoded representation of platform information.
Warning
This property is deprecated on Platform.
It is only implemented by the legacy LocalPlatform and FakePlatform
classes, and cannot be accessed through Platform.current.
Use NativePlatform to access these properties instead, accessed as
NativePlatform.current.
Can be emitted for debugging, or be used as input to a fake environment used for debugging.
Implementation
@override
String toJson() {
return const JsonEncoder.withIndent(' ').convert(<String, dynamic>{
json_key.numberOfProcessors: numberOfProcessors,
json_key.pathSeparator: pathSeparator,
json_key.operatingSystem: operatingSystem,
json_key.operatingSystemVersion: operatingSystemVersion,
json_key.localHostname: localHostname,
json_key.environment: environment,
json_key.executable: executable,
json_key.resolvedExecutable: resolvedExecutable,
json_key.script: script.toString(),
json_key.executableArguments: executableArguments,
json_key.packageConfig: packageConfig,
json_key.version: version,
json_key.stdinSupportsAnsi: stdinSupportsAnsi,
json_key.stdoutSupportsAnsi: stdoutSupportsAnsi,
json_key.localeName: localeName,
});
}