8000 Remove unnecessary nullable types in examples. by ksokolovskyi · Pull Request #176713 · flutter/flutter · GitHub
[go: up one dir, main page]

Skip to content

Conversation

ksokolovskyi
Copy link
Contributor
@ksokolovskyi ksokolovskyi commented Oct 8, 2025

Description

  • Removes unnecessary bool? usage in examples

Pre-laun 8000 ch Checklist

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: cupertino flutter/packages/flutter/cupertino repository d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos labels Oct 8, 2025
Copy link
Contributor
@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly removes unnecessary nullable types from onChanged callbacks in several examples, which improves code clarity and aligns with best practices. I've found 8000 one area where the implementation can be further improved for better readability and adherence to idiomatic Dart/Flutter code.

@stuartmorgan-g
Copy link
Contributor

test-exempt: code refactor with no semantic change

@dkwingsmt dkwingsmt requested review from Piinks and dkwingsmt October 8, 2025 18:32
Copy link
Contributor
@dkwingsmt dkwingsmt left a comment

Choose a reason for hiding this comment

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

LGTM! (I'm surprised that these files compile at all)

@ksokolovskyi
Copy link
Contributor Author

LGTM! (I'm surprised that these files compile at all)

@dkwingsmt, me either. Thanks a lot for the review!

According to the Gemini:

Your code compiles and works because Dart allows a function that accepts a nullable type (e.g., bool?) to be assigned to a parameter that expects a function accepting a non-nullable type (e.g., bool). This is known as covariance in function parameters (or the "Liskov Substitution Principle" applied to functions).

@ksokolovskyi ksokolovskyi added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 10, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Oct 10, 2025
Merged via the queue into flutter:master with commit 309bde1 Oct 10, 2025
46 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0