From 22bf7f214c00c45abf286f3235ec7afdab090899 Mon Sep 17 00:00:00 2001 From: Istvan Soos Date: Fri, 27 Dec 2024 13:39:00 +0100 Subject: [PATCH] Upgraded lints. --- lib/src/pubspec.dart | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/src/pubspec.dart b/lib/src/pubspec.dart index f739c29c3..a09ade5c2 100644 --- a/lib/src/pubspec.dart +++ b/lib/src/pubspec.dart @@ -76,11 +76,9 @@ class Pubspec { _dependentSdks!.add(value.sdk); } } - if (_inner.environment != null) { - final keys = _inner.environment!.keys.toList(); - keys.remove('sdk'); - _dependentSdks!.addAll(keys); - } + final keys = _inner.environment.keys.toList(); + keys.remove('sdk'); + _dependentSdks!.addAll(keys); } return _dependentSdks!; } @@ -119,10 +117,10 @@ class Pubspec { .any((d) => d is GitDependency && (d.ref == null || d.ref!.length < 40)); SdkConstraintStatus get sdkConstraintStatus => - SdkConstraintStatus.fromSdkVersion(_inner.environment?['sdk']); + SdkConstraintStatus.fromSdkVersion(_inner.environment['sdk']); VersionConstraint? get dartSdkConstraint { - final constraint = _inner.environment?['sdk']; + final constraint = _inner.environment['sdk']; // If a package is null safe it should also be compatible with dart 3. // Therefore we rewrite a null-safety enabled constraint with the upper // bound <3.0.0 to be have upper bound <4.0.0 @@ -147,7 +145,7 @@ class Pubspec { VersionConstraint? get flutterSdkConstraint => // Flutter constraints get special treatment, as Flutter won't be // using semantic versioning to mark breaking releases. - _removeUpperBound(_inner.environment?['flutter']); + _removeUpperBound(_inner.environment['flutter']); VersionConstraint? _removeUpperBound(VersionConstraint? constraint) { if (constraint is VersionRange) {