@@ -20,7 +20,6 @@ const _buildAppFlag = 'build-app';
2020const _machineFlag = 'machine' ;
2121const _dtdUriFlag = 'dtd-uri' ;
2222const _allowEmbeddingFlag = 'allow-embedding' ;
23- const _serveWithDartSdkFlag = 'serve-with-dart-sdk' ;
2423
2524/// This command builds DevTools in release mode by running the
2625/// `dt build` command and then serves DevTools with a locally
@@ -86,6 +85,7 @@ class ServeCommand extends Command {
8685 ' directly from the DevTools server.' ,
8786 )
8887 ..addDebugServerFlag ()
88+ ..addServeWithSdkOption ()
8989 ..addUpdateFlutterFlag ()
9090 ..addUpdatePerfettoFlag ()
9191 ..addPubGetFlag ()
@@ -105,12 +105,6 @@ class ServeCommand extends Command {
105105 ..addFlag (
106106 _allowEmbeddingFlag,
107107 help: 'Allow embedding DevTools inside an iframe.' ,
108- )
109- ..addOption (
110- _serveWithDartSdkFlag,
111- help: 'Uses the specified Dart SDK to serve the DevTools server' ,
112- valueHelp:
113- '/Users/me/absolute_path_to/sdk/xcodebuild/ReleaseX64/dart-sdk/bin/dart' ,
114108 );
115109 }
116110
@@ -156,7 +150,8 @@ class ServeCommand extends Command {
156150 final runPubGet = results[SharedCommandArgs .pubGet.flagName] as bool ;
157151 final devToolsAppBuildMode =
158152 results[SharedCommandArgs .buildMode.flagName] as String ;
159- final serveWithDartSdk = results[_serveWithDartSdkFlag] as String ? ;
153+ final serveWithDartSdk =
154+ results[SharedCommandArgs .serveWithDartSdk.flagName] as String ? ;
160155 final forMachine = results[_machineFlag] as bool ;
161156
162157 // TODO(https://github.com/flutter/devtools/issues/8643): Support running in
@@ -188,7 +183,9 @@ class ServeCommand extends Command {
188183 element.startsWith (SharedCommandArgs .buildMode.asArg ()),
189184 )
190185 ..removeWhere (
191- (element) => element.startsWith (valueAsArg (_serveWithDartSdkFlag)),
186+ (element) => element.startsWith (
187+ valueAsArg (SharedCommandArgs .serveWithDartSdk.flagName),
188+ ),
192189 );
193190
194191 final localDartSdkLocation = Platform .environment['LOCAL_DART_SDK' ];
0 commit comments