copyWith method
- @visibleForTesting
- Map<
String, String> ? environment, - String? executable,
- List<
String> ? executableArguments, - String? lineTerminator,
- String? localeName,
- String? localHostname,
- int? numberOfProcessors,
- String? operatingSystem,
- String? operatingSystemVersion,
- String? packageConfig,
- String? pathSeparator,
- String? resolvedExecutable,
- Uri? script,
- bool? stdinSupportsAnsi,
- bool? stdoutSupportsAnsi,
- String? version,
Creates a new TestNativePlatform from this one.
If a parameter is given non-null argument value,
the created object will have that value for the corresponding property,
otherwise it will use this object's value for that property.
Implementation
@visibleForTesting
TestNativePlatform copyWith({
Map<String, String>? environment,
String? executable,
List<String>? executableArguments,
String? lineTerminator,
String? localeName,
String? localHostname,
int? numberOfProcessors,
String? operatingSystem,
String? operatingSystemVersion,
String? packageConfig,
String? pathSeparator,
String? resolvedExecutable,
Uri? script,
bool? stdinSupportsAnsi,
bool? stdoutSupportsAnsi,
String? version,
}) {
return TestNativePlatform(
environment:
environment ??
(_environment == null ? null : <String, String>{..._environment}),
executable: executable ?? _executable,
executableArguments: (executableArguments ?? _executableArguments)
?.toList(),
lineTerminator: lineTerminator ?? _lineTerminator,
localeName: localeName ?? _localeName,
localHostname: localHostname ?? _localHostname,
numberOfProcessors: numberOfProcessors ?? _numberOfProcessors,
operatingSystem: operatingSystem ?? _operatingSystem,
operatingSystemVersion: operatingSystemVersion ?? _operatingSystemVersion,
packageConfig: packageConfig ?? this.packageConfig,
pathSeparator: pathSeparator ?? _pathSeparator,
resolvedExecutable: resolvedExecutable ?? _resolvedExecutable,
script: script ?? _script,
stdinSupportsAnsi: stdinSupportsAnsi ?? _stdinSupportsAnsi,
stdoutSupportsAnsi: stdoutSupportsAnsi ?? _stdoutSupportsAnsi,
version: version ?? _version,
);
}