@@ -20,7 +20,6 @@ const _buildAppFlag = 'build-app';
20
20
const _machineFlag = 'machine' ;
21
21
const _dtdUriFlag = 'dtd-uri' ;
22
22
const _allowEmbeddingFlag = 'allow-embedding' ;
23
- const _serveWithDartSdkFlag = 'serve-with-dart-sdk' ;
24
23
25
24
/// This command builds DevTools in release mode by running the
26
25
/// `dt build` command and then serves DevTools with a locally
@@ -86,6 +85,7 @@ class ServeCommand extends Command {
86
85
' directly from the DevTools server.' ,
87
86
)
88
87
..addDebugServerFlag ()
88
+ ..addServeWithSdkOption ()
89
89
..addUpdateFlutterFlag ()
90
90
..addUpdatePerfettoFlag ()
91
91
..addPubGetFlag ()
@@ -105,12 +105,6 @@ class ServeCommand extends Command {
105
105
..addFlag (
106
106
_allowEmbeddingFlag,
107
107
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' ,
114
108
);
115
109
}
116
110
@@ -156,7 +150,8 @@ class ServeCommand extends Command {
156
150
final runPubGet = results[SharedCommandArgs .pubGet.flagName] as bool ;
157
151
final devToolsAppBuildMode =
158
152
results[SharedCommandArgs .buildMode.flagName] as String ;
159
- final serveWithDartSdk = results[_serveWithDartSdkFlag] as String ? ;
153
+ final serveWithDartSdk =
154
+ results[SharedCommandArgs .serveWithDartSdk.flagName] as String ? ;
160
155
final forMachine = results[_machineFlag] as bool ;
161
156
162
157
// TODO(https://github.com/flutter/devtools/issues/8643): Support running in
@@ -188,7 +183,9 @@ class ServeCommand extends Command {
188
183
element.startsWith (SharedCommandArgs .buildMode.asArg ()),
189
184
)
190
185
..removeWhere (
191
- (element) => element.startsWith (valueAsArg (_serveWithDartSdkFlag)),
186
+ (element) => element.startsWith (
187
+ valueAsArg (SharedCommandArgs .serveWithDartSdk.flagName),
188
+ ),
192
189
);
193
190
194
191
final localDartSdkLocation = Platform .environment['LOCAL_DART_SDK' ];
0 commit comments