@@ -181,33 +181,34 @@ known, it can be explicitly provided to attach via the command-line, e.g.
181181 return null ;
182182 }
183183 try {
184- return int .parse (stringArgDeprecated ('debug-port' )! );
184+ return int .parse (stringArg ('debug-port' )! );
185185 } on Exception catch (error) {
186186 throwToolExit ('Invalid port for `--debug-port`: $error ' );
187187 }
188188 }
189189
190190 Uri ? get debugUri {
191- if (argResults! ['debug-url' ] == null ) {
191+ final String ? debugUrl = stringArg ('debug-url' );
192+ if (debugUrl == null ) {
192193 return null ;
193194 }
194- final Uri ? uri = Uri .tryParse (stringArgDeprecated ( 'debug-url' ) ! );
195+ final Uri ? uri = Uri .tryParse (debugUrl );
195196 if (uri == null ) {
196- throwToolExit ('Invalid `--debug-url`: ${ stringArgDeprecated ( 'debug-url' )} ' );
197+ throwToolExit ('Invalid `--debug-url`: $debugUrl ' );
197198 }
198199 if (! uri.hasPort) {
199200 throwToolExit ('Port not specified for `--debug-url`: $uri ' );
200201 }
201202 return uri;
202203 }
203204
204- bool get serveObservatory => boolArg ('serve-observatory' ) ?? false ;
205+ bool get serveObservatory => boolArg ('serve-observatory' );
205206
206207 String ? get appId {
207- return stringArgDeprecated ('app-id' );
208+ return stringArg ('app-id' );
208209 }
209210
210- String ? get userIdentifier => stringArgDeprecated (FlutterOptions .kDeviceUser);
211+ String ? get userIdentifier => stringArg (FlutterOptions .kDeviceUser);
211212
212213 @override
213214 Future <void > validateCommand () async {
@@ -268,7 +269,7 @@ known, it can be explicitly provided to attach via the command-line, e.g.
268269 Future <void > _attachToDevice (Device device) async {
269270 final FlutterProject flutterProject = FlutterProject .current ();
270271
271- final Daemon ? daemon = boolArgDeprecated ('machine' )
272+ final Daemon ? daemon = boolArg ('machine' )
272273 ? Daemon (
273274 DaemonConnection (
274275 daemonStreams: DaemonStreams .fromStdio (_stdio, logger: _logger),
@@ -290,7 +291,7 @@ known, it can be explicitly provided to attach via the command-line, e.g.
290291
291292 if ((debugPort == null && debugUri == null ) || isNetworkDevice) {
292293 if (device is FuchsiaDevice ) {
293- final String ? module = stringArgDeprecated ('module' );
294+ final String ? module = stringArg ('module' );
294295 if (module == null ) {
295296 throwToolExit ("'--module' is required for attaching to a Fuchsia device" );
296297 }
@@ -428,7 +429,7 @@ known, it can be explicitly provided to attach via the command-line, e.g.
428429 connectionInfoCompleter: connectionInfoCompleter,
429430 appStartedCompleter: appStartedCompleter,
430431 allowExistingDdsInstance: true ,
431- enableDevTools: boolArgDeprecated (FlutterCommand .kEnableDevTools),
432+ enableDevTools: boolArg (FlutterCommand .kEnableDevTools),
432433 );
433434 },
434435 device,
@@ -460,16 +461,16 @@ known, it can be explicitly provided to attach via the command-line, e.g.
460461 terminal: _terminal,
461462 signals: _signals,
462463 processInfo: _processInfo,
463- reportReady: boolArgDeprecated ('report-ready' ),
464- pidFile: stringArgDeprecated ('pid-file' ),
464+ reportReady: boolArg ('report-ready' ),
465+ pidFile: stringArg ('pid-file' ),
465466 )
466467 ..registerSignalHandlers ()
467468 ..setupTerminal ();
468469 }));
469470 result = await runner.attach (
470471 appStartedCompleter: onAppStart,
471472 allowExistingDdsInstance: true ,
472- enableDevTools: boolArgDeprecated (FlutterCommand .kEnableDevTools),
473+ enableDevTools: boolArg (FlutterCommand .kEnableDevTools),
473474 );
474475 if (result != 0 ) {
475476 throwToolExit (null , exitCode: result);
@@ -505,7 +506,7 @@ known, it can be explicitly provided to attach via the command-line, e.g.
505506 final FlutterDevice flutterDevice = await FlutterDevice .create (
506507 device,
507508 target: targetFile,
508- targetModel: TargetModel (stringArgDeprecated ('target-model' )! ),
509+ targetModel: TargetModel (stringArg ('target-model' )! ),
509510 buildInfo: buildInfo,
510511 userIdentifier: userIdentifier,
511512 platform: _platform,
@@ -526,8 +527,8 @@ known, it can be explicitly provided to attach via the command-line, e.g.
526527 target: targetFile,
527528 debuggingOptions: debuggingOptions,
528529 packagesFilePath: globalResults! ['packages' ] as String ? ,
529- projectRootPath: stringArgDeprecated ('project-root' ),
530- dillOutputPath: stringArgDeprecated ('output-dill' ),
530+ projectRootPath: stringArg ('project-root' ),
531+ dillOutputPath: stringArg ('output-dill' ),
531532 ipv6: usesIpv6,
532533 flutterProject: flutterProject,
533534 )
0 commit comments