@@ -37,6 +37,7 @@ const nullSafetyAuto = 'auto';
3737const disableDdsFlag = 'disable-dds' ;
3838const enableExperimentOption = 'enable-experiment' ;
3939const canaryFeaturesFlag = 'canary' ;
40+ const offlineFlag = 'offline' ;
4041
4142ReloadConfiguration _parseReloadConfiguration (ArgResults argResults) {
4243 var auto = argResults.options.contains (autoOption)
@@ -107,6 +108,7 @@ class Configuration {
107108 final String ? _nullSafety;
108109 final List <String >? _experiments;
109110 final bool ? _canaryFeatures;
111+ final bool ? _offline;
110112
111113 Configuration ({
112114 bool ? autoRun,
@@ -133,6 +135,7 @@ class Configuration {
133135 String ? nullSafety,
134136 List <String >? experiments,
135137 bool ? canaryFeatures,
138+ bool ? offline,
136139 }) : _autoRun = autoRun,
137140 _chromeDebugPort = chromeDebugPort,
138141 _debugExtension = debugExtension,
@@ -154,7 +157,8 @@ class Configuration {
154157 _verbose = verbose,
155158 _nullSafety = nullSafety,
156159 _experiments = experiments,
157- _canaryFeatures = canaryFeatures {
160+ _canaryFeatures = canaryFeatures,
161+ _offline = offline {
158162 _validateConfiguration ();
159163 }
160164
@@ -229,7 +233,8 @@ class Configuration {
229233 verbose: other._verbose ?? _verbose,
230234 nullSafety: other._nullSafety ?? _nullSafety,
231235 experiments: other._experiments ?? _experiments,
232- canaryFeatures: other._canaryFeatures ?? _canaryFeatures);
236+ canaryFeatures: other._canaryFeatures ?? _canaryFeatures,
237+ offline: other._offline ?? _offline);
233238
234239 factory Configuration .noInjectedClientDefaults () =>
235240 Configuration (autoRun: false , debug: false , debugExtension: false );
@@ -284,6 +289,8 @@ class Configuration {
284289
285290 bool get canaryFeatures => _canaryFeatures ?? false ;
286291
292+ bool get offline => _offline ?? false ;
293+
287294 /// Returns a new configuration with values updated from the parsed args.
288295 static Configuration fromArgs (ArgResults ? argResults,
289296 {Configuration ? defaultConfiguration}) {
@@ -408,6 +415,10 @@ class Configuration {
408415 ? argResults[canaryFeaturesFlag] as bool ?
409416 : defaultConfiguration.canaryFeatures;
410417
418+ var offline = argResults.options.contains (offlineFlag)
419+ ? argResults[offlineFlag] as bool ?
420+ : defaultConfiguration.verbose;
421+
411422 return Configuration (
412423 autoRun: defaultConfiguration.autoRun,
413424 chromeDebugPort: chromeDebugPort,
@@ -433,6 +444,7 @@ class Configuration {
433444 nullSafety: nullSafety,
434445 experiments: experiments,
435446 canaryFeatures: canaryFeatures,
447+ offline: offline,
436448 );
437449 }
438450}
0 commit comments