clone method

RunOptions clone({
  1. String? workingDirectory,
  2. Map<String, String>? environment,
  3. bool? includeParentEnvironment,
  4. bool? runInShell,
  5. Encoding? stdoutEncoding,
  6. Encoding? stderrEncoding,
})

Create a clone with updated values in one step. For omitted parameters values of the original instance are copied.

Implementation

RunOptions clone(
    {String? workingDirectory,
    Map<String, String>? environment,
    bool? includeParentEnvironment,
    bool? runInShell,
    Encoding? stdoutEncoding,
    Encoding? stderrEncoding}) {
  return RunOptions(
      workingDirectory: workingDirectory ?? this.workingDirectory,
      environment: environment != null
          ? Map.from(environment)
          : Map.from(this.environment),
      includeParentEnvironment:
          includeParentEnvironment ?? this.includeParentEnvironment,
      runInShell: runInShell ?? this.runInShell,
      stdoutEncoding: stdoutEncoding ?? this.stdoutEncoding,
      stderrEncoding: stderrEncoding ?? this.stderrEncoding);
}