@@ -140,12 +140,6 @@ class PubContext {
140140 }
141141}
142142
143- enum PubOutputMode {
144- none,
145- standard,
146- summaryOnly,
147- }
148-
149143/// A handle for interacting with the pub tool.
150144abstract class Pub {
151145 /// Create a default [Pub] instance.
@@ -178,6 +172,10 @@ abstract class Pub {
178172 /// If [shouldSkipThirdPartyGenerator] is true, the overall pub get will be
179173 /// skipped if the package config file has a "generator" other than "pub".
180174 /// Defaults to true.
175+ ///
176+ /// If [printProgress] is true, `pub get` will inherit stdio from the current process.
177+ /// Defaults to true.
178+ ///
181179 /// Will also resolve dependencies in the example folder if present.
182180 Future <void > get ({
183181 required PubContext context,
@@ -187,7 +185,7 @@ abstract class Pub {
187185 String ? flutterRootOverride,
188186 bool checkUpToDate = false ,
189187 bool shouldSkipThirdPartyGenerator = true ,
190- PubOutputMode outputMode = PubOutputMode .standard
188+ bool printProgress = true ,
191189 });
192190
193191 /// Runs pub in 'batch' mode.
@@ -227,7 +225,7 @@ abstract class Pub {
227225 required String command,
228226 bool touchesPackageConfig = false ,
229227 bool generateSyntheticPackage = false ,
230- PubOutputMode outputMode = PubOutputMode .standard
228+ bool printProgress = true ,
231229 });
232230}
233231
@@ -292,7 +290,7 @@ class _DefaultPub implements Pub {
292290 String ? flutterRootOverride,
293291 bool checkUpToDate = false ,
294292 bool shouldSkipThirdPartyGenerator = true ,
295- PubOutputMode outputMode = PubOutputMode .standard
293+ bool printProgress = true ,
296294 }) async {
297295 final String directory = project.directory.path;
298296 final File packageConfigFile = project.packageConfigFile;
@@ -364,7 +362,7 @@ class _DefaultPub implements Pub {
364362 directory: directory,
365363 failureMessage: 'pub $command failed' ,
366364 flutterRootOverride: flutterRootOverride,
367- outputMode : outputMode ,
365+ printProgress : printProgress ,
368366 );
369367 await _updateVersionAndPackageConfig (project);
370368 }
@@ -381,19 +379,19 @@ class _DefaultPub implements Pub {
381379 Future <void > _runWithStdioInherited (
382380 List <String > arguments, {
383381 required String command,
384- required PubOutputMode outputMode,
385382 required PubContext context,
386383 required String directory,
387384 String failureMessage = 'pub failed' ,
388385 String ? flutterRootOverride,
386+ bool printProgress = true
389387 }) async {
390388 int exitCode;
391389
392390 final List <String > pubCommand = _pubCommand (arguments);
393- final Map <String , String > pubEnvironment = await _createPubEnvironment (context: context, flutterRootOverride: flutterRootOverride, summaryOnly: outputMode == PubOutputMode .summaryOnly );
391+ final Map <String , String > pubEnvironment = await _createPubEnvironment (context: context, flutterRootOverride: flutterRootOverride, summaryOnly: printProgress );
394392
395393 try {
396- if (outputMode != PubOutputMode .none ) {
394+ if (printProgress ) {
397395 final io.Stdio ? stdio = _stdio;
398396 if (stdio == null ) {
399397 // Let pub inherit stdio and output directly to the tool's stdout and
@@ -564,14 +562,14 @@ class _DefaultPub implements Pub {
564562 required String command,
565563 bool touchesPackageConfig = false ,
566564 bool generateSyntheticPackage = false ,
567- PubOutputMode outputMode = PubOutputMode .standard
565+ bool printProgress = true ,
568566 }) async {
569567 await _runWithStdioInherited (
570568 arguments,
571569 command: command,
572570 directory: _fileSystem.currentDirectory.path,
573571 context: context,
574- outputMode : outputMode ,
572+ printProgress : printProgress ,
575573 );
576574 if (touchesPackageConfig && project != null ) {
577575 await _updateVersionAndPackageConfig (project);
0 commit comments