Skip to content

Conversation

reidbaker
Copy link
Contributor

dart analyze fails at tip of tree. Not sure why the tree isnt red but it should be .


warning • packages/flutter_tools/test/commands.shard/permeable/create_test.dart:3663:68 • The '!' will have no effect because the receiver
          can't be null. Try removing the '!' operator. • unnecessary_non_null_assertion
warning • packages/flutter_tools/test/commands.shard/permeable/create_test.dart:4340:26 • The '!' will have no effect because the receiver
          can't be null. Try removing the '!' operator. • unnecessary_non_null_assertion

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Dec 20, 2024
final String rawPubspec = await projectDir.childFile('pubspec.yaml').readAsString();
final Pubspec pubspec = Pubspec.parse(rawPubspec);
final Map<String, VersionConstraint?> env = pubspec.environment!;
final Map<String, VersionConstraint?> env = pubspec.environment;
Copy link
Member

@goderbauer goderbauer Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That ! should be required here, though. Pubspec.environment [1] is a nullable type that is assigned to a non-nullable variable.

[1] https://pub.dev/documentation/pubspec_parse/1.3.0/pubspec_parse/Pubspec/environment.html

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you run package updated-packages to see if that fixes the problem for you?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran flutter update-package and without any file changes the lint error went away.

@reidbaker reidbaker closed this Dec 20, 2024
@reidbaker reidbaker deleted the r-lint-warning-2024-12-20-fix-tree branch December 20, 2024 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants