forEach method Null safety

void forEach(
  1. LineAction stdout,
  2. {LineAction stderr = devNull}
)

Implementation

void forEach(LineAction stdout, {LineAction stderr = devNull}) {
  /// This is somewhat dodgy as we essentially replace the progresses
  /// stdout and stderr handlers that we setup when the
  /// progress was originally created. We need to find
  /// a more self consistent approach as this behavour can endup
  /// with the user getting inconsistent results
  /// e.g. they essentially pass stdout and stderr twice.
  _includeStdout = true;
  if (stderr != devNull) {
    _includeStderr = true;
  }
  _processUntilComplete(stdout, stderr: stderr);
}