Skip to content

Commit

Permalink
Update to language version 3.2 and make use of private field promotion
Browse files Browse the repository at this point in the history
  • Loading branch information
parlough committed Dec 2, 2023
1 parent 531fcd4 commit a7201cd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions lib/src/authentication/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ class _AuthenticatedClient extends http.BaseClient {
// request.
//
// This check ensures that this client will only authenticate requests sent
// to given serverBaseUrl. Otherwise credential leaks might ocurr when
// to given serverBaseUrl. Otherwise credential leaks might occur when
// archive_url hosted on 3rd party server that should not receive
// credentials of the first party.
if (_credential != null &&
_credential!.canAuthenticate(request.url.toString())) {
_credential.canAuthenticate(request.url.toString())) {
request.headers[HttpHeaders.authorizationHeader] =
await _credential!.getAuthorizationHeaderValue();
await _credential.getAuthorizationHeaderValue();
}

final response = await _inner.send(request);
Expand Down
4 changes: 2 additions & 2 deletions lib/src/command/outdated.dart
Original file line number Diff line number Diff line change
Expand Up @@ -952,8 +952,8 @@ class _MarkedVersionDetails implements _Details {

var jsonExplanation = _jsonExplanation;
return jsonExplanation == null
? _versionDetails!.toJson()
: (_versionDetails!.toJson()..addEntries([jsonExplanation]));
? _versionDetails.toJson()
: (_versionDetails.toJson()..addEntries([jsonExplanation]));
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/src/solver/package_lister.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class PackageLister {

/// Returns the number of versions of this package that match [constraint].
Future<int> countVersions(VersionConstraint constraint) async {
if (_locked != null && constraint.allows(_locked!.version)) return 1;
if (_locked != null && constraint.allows(_locked.version)) return 1;
try {
return (await _versions)
.where((id) => constraint.allows(id.version))
Expand Down Expand Up @@ -226,7 +226,7 @@ class PackageLister {

if (_cachedVersions == null &&
_locked != null &&
id.version == _locked!.version) {
id.version == _locked.version) {
if (_listedLockedVersion) return const [];

var depender = id.toRange();
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: pub

environment:
sdk: ^3.0.0
sdk: ^3.2.0

dependencies:
analyzer: ^6.2.0
Expand Down

0 comments on commit a7201cd

Please sign in to comment.