Implementing null-aware operators throughout the repository (#143804)
This pull request fixes #143803 by taking advantage of Dart's null-aware operators. And unlike `switch` expressions ([9 PRs](https://github.com/flutter/flutter/pull/143634) and counting), the Flutter codebase is already fantastic when it comes to null-aware coding. After refactoring the entire repo, all the changes involving `?.` and `??` can fit into a single pull request.
This commit is contained in:
@@ -86,9 +86,7 @@ Future<void> main(List<String> args) async {
|
||||
final Map<String, dynamic> tokenFileTokens = _readTokenFile(tokenFile as File);
|
||||
final String version = tokenFileTokens['version'] as String;
|
||||
tokenFileTokens.remove('version');
|
||||
if (versionMap[version] == null) {
|
||||
versionMap[version] = List<String>.empty(growable: true);
|
||||
}
|
||||
versionMap[version] ??= <String>[];
|
||||
versionMap[version]!.add(tokenFile.uri.pathSegments.last);
|
||||
|
||||
tokens.addAll(tokenFileTokens);
|
||||
|
||||
Reference in New Issue
Block a user