@@ -14,7 +14,7 @@ import '../runner/flutter_command.dart';
1414class PrecacheCommand extends FlutterCommand {
1515 PrecacheCommand ({
1616 bool verboseHelp = false ,
17- required Cache ? cache,
17+ required Cache cache,
1818 required Platform platform,
1919 required Logger logger,
2020 required FeatureFlags featureFlags,
@@ -58,7 +58,7 @@ class PrecacheCommand extends FlutterCommand {
5858 help: 'Precache the unsigned macOS binaries when available.' , hide: ! verboseHelp);
5959 }
6060
61- final Cache ? _cache;
61+ final Cache _cache;
6262 final Logger _logger;
6363 final Platform _platform;
6464 final FeatureFlags _featureFlags;
@@ -133,21 +133,21 @@ class PrecacheCommand extends FlutterCommand {
133133 Future <FlutterCommandResult > runCommand () async {
134134 // Re-lock the cache.
135135 if (_platform.environment['FLUTTER_ALREADY_LOCKED' ] != 'true' ) {
136- await _cache! .lock ();
136+ await _cache.lock ();
137137 }
138138 if (boolArgDeprecated ('force' )) {
139- _cache! .clearStampFiles ();
139+ _cache.clearStampFiles ();
140140 }
141141
142142 final bool includeAllPlatforms = boolArgDeprecated ('all-platforms' );
143143 if (includeAllPlatforms) {
144- _cache! .includeAllPlatforms = true ;
144+ _cache.includeAllPlatforms = true ;
145145 }
146146 if (boolArgDeprecated ('use-unsigned-mac-binaries' )) {
147- _cache! .useUnsignedMacBinaries = true ;
147+ _cache.useUnsignedMacBinaries = true ;
148148 }
149149 final Set <String > explicitlyEnabled = _explicitArtifactSelections ();
150- _cache! .platformOverrideArtifacts = explicitlyEnabled;
150+ _cache.platformOverrideArtifacts = explicitlyEnabled;
151151
152152 // If the user did not provide any artifact flags, then download
153153 // all artifacts that correspond to an enabled platform.
@@ -164,8 +164,8 @@ class PrecacheCommand extends FlutterCommand {
164164 requiredArtifacts.add (artifact);
165165 }
166166 }
167- if (! await _cache! .isUpToDate ()) {
168- await _cache! .updateAll (requiredArtifacts);
167+ if (! await _cache.isUpToDate ()) {
168+ await _cache.updateAll (requiredArtifacts);
169169 } else {
170170 _logger.printStatus ('Already up-to-date.' );
171171 }
0 commit comments