Skip to content

Commit e30495e

Browse files
committed
removed removed operator and right operand
1 parent cbd5cb8 commit e30495e

6 files changed

+15
-15
lines changed

script/tool/lib/src/common/package_looping_command.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ abstract class PackageLoopingCommand extends PackageCommand {
340340
if (minFlutterVersion != null) {
341341
final Pubspec pubspec = package.parsePubspec();
342342
final VersionConstraint? flutterConstraint =
343-
pubspec.environment?['flutter'];
343+
pubspec.environment['flutter'];
344344
if (flutterConstraint != null &&
345345
!flutterConstraint.allows(minFlutterVersion)) {
346346
return PackageResult.skip(
@@ -350,7 +350,7 @@ abstract class PackageLoopingCommand extends PackageCommand {
350350

351351
if (minDartVersion != null) {
352352
final Pubspec pubspec = package.parsePubspec();
353-
final VersionConstraint? dartConstraint = pubspec.environment?['sdk'];
353+
final VersionConstraint? dartConstraint = pubspec.environment['sdk'];
354354
if (dartConstraint != null && !dartConstraint.allows(minDartVersion)) {
355355
return PackageResult.skip('Does not support Dart $minDartVersion');
356356
}

script/tool/lib/src/create_all_packages_app_command.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ dependencies {}
277277
final Pubspec originalPubspec = app.parsePubspec();
278278
const String dartSdkKey = 'sdk';
279279
final VersionConstraint dartSdkConstraint =
280-
originalPubspec.environment?[dartSdkKey] ??
280+
originalPubspec.environment[dartSdkKey] ??
281281
VersionConstraint.compatibleWith(
282282
Version.parse('3.0.0'),
283283
);
@@ -342,7 +342,7 @@ publish_to: none
342342
343343
version: ${pubspec.version}
344344
345-
environment:${_pubspecMapString(pubspec.environment!)}
345+
environment:${_pubspecMapString(pubspec.environment)}
346346
347347
dependencies:${_pubspecMapString(pubspec.dependencies)}
348348

script/tool/lib/src/pubspec_check_command.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,9 @@ class PubspecCheckCommand extends PackageLoopingCommand {
488488
}
489489

490490
final Version? dartConstraintMin =
491-
_minimumForConstraint(pubspec.environment?['sdk']);
491+
_minimumForConstraint(pubspec.environment['sdk']);
492492
final Version? flutterConstraintMin =
493-
_minimumForConstraint(pubspec.environment?['flutter']);
493+
_minimumForConstraint(pubspec.environment['flutter']);
494494

495495
// Validate the Flutter constraint, if any.
496496
if (flutterConstraintMin != null && minMinFlutterVersion != null) {

script/tool/lib/src/update_min_sdk_command.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class UpdateMinSdkCommand extends PackageLoopingCommand {
8787
/// Returns the given "environment" section's [key] constraint as a range,
8888
/// if the key is present and has a range.
8989
VersionRange? _sdkRange(Pubspec pubspec, String key) {
90-
final VersionConstraint? constraint = pubspec.environment?[key];
90+
final VersionConstraint? constraint = pubspec.environment[key];
9191
if (constraint is VersionRange) {
9292
return constraint;
9393
}

script/tool/test/create_all_packages_app_command_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ android {
356356
final Pubspec generatedPubspec = command.app.parsePubspec();
357357

358358
const String dartSdkKey = 'sdk';
359-
expect(generatedPubspec.environment?[dartSdkKey].toString(),
359+
expect(generatedPubspec.environment[dartSdkKey].toString(),
360360
existingSdkConstraint);
361361
});
362362

script/tool/test/update_min_sdk_command_test.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void main() {
5050
]);
5151

5252
final String dartVersion =
53-
package.parsePubspec().environment?['sdk'].toString() ?? '';
53+
package.parsePubspec().environment['sdk'].toString();
5454
expect(dartVersion, '^3.1.0');
5555
});
5656

@@ -65,7 +65,7 @@ void main() {
6565
]);
6666

6767
final String dartVersion =
68-
package.parsePubspec().environment?['sdk'].toString() ?? '';
68+
package.parsePubspec().environment['sdk'].toString();
6969
expect(dartVersion, '^3.1.0');
7070
});
7171

@@ -80,7 +80,7 @@ void main() {
8080
]);
8181

8282
final String dartVersion =
83-
package.parsePubspec().environment?['sdk'].toString() ?? '';
83+
package.parsePubspec().environment['sdk'].toString();
8484
expect(dartVersion, '^3.2.0');
8585
});
8686

@@ -98,9 +98,9 @@ void main() {
9898
]);
9999

100100
final String dartVersion =
101-
package.parsePubspec().environment?['sdk'].toString() ?? '';
101+
package.parsePubspec().environment['sdk'].toString();
102102
final String flutterVersion =
103-
package.parsePubspec().environment?['flutter'].toString() ?? '';
103+
package.parsePubspec().environment['flutter'].toString();
104104
expect(dartVersion, '^3.1.0');
105105
expect(flutterVersion, '>=3.13.0');
106106
});
@@ -119,9 +119,9 @@ void main() {
119119
]);
120120

121121
final String dartVersion =
122-
package.parsePubspec().environment?['sdk'].toString() ?? '';
122+
package.parsePubspec().environment['sdk'].toString();
123123
final String flutterVersion =
124-
package.parsePubspec().environment?['flutter'].toString() ?? '';
124+
package.parsePubspec().environment['flutter'].toString();
125125
expect(dartVersion, '^3.2.0');
126126
expect(flutterVersion, '>=3.16.0');
127127
});

0 commit comments

Comments
 (0)