@@ -37,6 +37,7 @@ const nullSafetyAuto = 'auto';
37
37
const disableDdsFlag = 'disable-dds' ;
38
38
const enableExperimentOption = 'enable-experiment' ;
39
39
const canaryFeaturesFlag = 'canary' ;
40
+ const offlineFlag = 'offline' ;
40
41
41
42
ReloadConfiguration _parseReloadConfiguration (ArgResults argResults) {
42
43
var auto = argResults.options.contains (autoOption)
@@ -107,6 +108,7 @@ class Configuration {
107
108
final String ? _nullSafety;
108
109
final List <String >? _experiments;
109
110
final bool ? _canaryFeatures;
111
+ final bool ? _offline;
110
112
111
113
Configuration ({
112
114
bool ? autoRun,
@@ -133,6 +135,7 @@ class Configuration {
133
135
String ? nullSafety,
134
136
List <String >? experiments,
135
137
bool ? canaryFeatures,
138
+ bool ? offline,
136
139
}) : _autoRun = autoRun,
137
140
_chromeDebugPort = chromeDebugPort,
138
141
_debugExtension = debugExtension,
@@ -154,7 +157,8 @@ class Configuration {
154
157
_verbose = verbose,
155
158
_nullSafety = nullSafety,
156
159
_experiments = experiments,
157
- _canaryFeatures = canaryFeatures {
160
+ _canaryFeatures = canaryFeatures,
161
+ _offline = offline {
158
162
_validateConfiguration ();
159
163
}
160
164
@@ -229,7 +233,8 @@ class Configuration {
229
233
verbose: other._verbose ?? _verbose,
230
234
nullSafety: other._nullSafety ?? _nullSafety,
231
235
experiments: other._experiments ?? _experiments,
232
- canaryFeatures: other._canaryFeatures ?? _canaryFeatures);
236
+ canaryFeatures: other._canaryFeatures ?? _canaryFeatures,
237
+ offline: other._offline ?? _offline);
233
238
234
239
factory Configuration .noInjectedClientDefaults () =>
235
240
Configuration (autoRun: false , debug: false , debugExtension: false );
@@ -284,6 +289,8 @@ class Configuration {
284
289
285
290
bool get canaryFeatures => _canaryFeatures ?? false ;
286
291
292
+ bool get offline => _offline ?? false ;
293
+
287
294
/// Returns a new configuration with values updated from the parsed args.
288
295
static Configuration fromArgs (ArgResults ? argResults,
289
296
{Configuration ? defaultConfiguration}) {
@@ -408,6 +415,10 @@ class Configuration {
408
415
? argResults[canaryFeaturesFlag] as bool ?
409
416
: defaultConfiguration.canaryFeatures;
410
417
418
+ var offline = argResults.options.contains (offlineFlag)
419
+ ? argResults[offlineFlag] as bool ?
420
+ : defaultConfiguration.verbose;
421
+
411
422
return Configuration (
412
423
autoRun: defaultConfiguration.autoRun,
413
424
chromeDebugPort: chromeDebugPort,
@@ -433,6 +444,7 @@ class Configuration {
433
444
nullSafety: nullSafety,
434
445
experiments: experiments,
435
446
canaryFeatures: canaryFeatures,
447
+ offline: offline,
436
448
);
437
449
}
438
450
}
0 commit comments