Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[two_dimensional_scrollables] Adds generics to the callbacks and builders of TreeView #6864

Merged
merged 9 commits into from
Jun 6, 2024

Conversation

baumths
Copy link
Contributor

@baumths baumths commented Jun 4, 2024

This PR adds generics to the callbacks and builders of the TreeView widget. This removes the need to type cast the content of a TreeViewNode.

Fixes flutter/flutter#149656

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@baumths baumths requested a review from Piinks as a code owner June 4, 2024 13:17
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

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.

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

Hey @baumths thanks for sending a PR! You beat me to it! :)

Can you add a test that prevents us from regressing this in the future? Just creating an instance of those callbacks and builders that does not have the type casts should cover it, like in the comment you left on the TreeSliver PR.

@baumths
Copy link
Contributor Author

baumths commented Jun 4, 2024

Added a test but I'm not sure if I did it the right way, never written such a test. Should I expect something else?

I've also updated the tree view tests to use the correct type in the callbacks, hope that's ok.

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

Test coverage is great thank you! Can you give it a minor version bump instead of +1?

packages/two_dimensional_scrollables/pubspec.yaml Outdated Show resolved Hide resolved
@baumths baumths requested a review from Piinks June 6, 2024 20:35
Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

Flutter_LGTM

@Piinks
Copy link
Contributor

Piinks commented Jun 6, 2024

I need to get a second stamp for this, will find another reviewer

Copy link
Contributor

@matanlurey matanlurey 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 had a question about whether adding generics is considered a breaking change, but it was answered ("no"). Thanks!

@matanlurey matanlurey added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 6, 2024
@auto-submit auto-submit bot merged commit fb1eeff into flutter:main Jun 6, 2024
74 checks passed
@baumths baumths deleted the tree-view-generics branch June 6, 2024 23:05
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 7, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jun 7, 2024
flutter/packages@586faa6...8a2c4e4

2024-06-06 [email protected] Revert "Migrate `video_player/android` from `SurfaceTexture`->`SurfaceProducer`." (flutter/packages#6882)
2024-06-06 [email protected] [two_dimensional_scrollables] Adds generics to the callbacks and builders of TreeView (flutter/packages#6864)
2024-06-06 [email protected] Run tests on macOS 13 or 14 (flutter/packages#6877)
2024-06-06 [email protected] Disable sandboxing directly for macOS tests (flutter/packages#6880)
2024-06-06 [email protected] [pigeon] Moves all codec logic to singular custom codec (flutter/packages#6600)
2024-06-06 [email protected] Roll Flutter (stable) from a14f74f to 761747b (6 revisions) (flutter/packages#6878)
2024-06-06 [email protected] Roll Flutter from 27e0656 to 4608a89 (17 revisions) (flutter/packages#6876)
2024-06-06 [email protected] Disable sandboxing for macOS tests in CI (flutter/packages#6866)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
arc-yong pushed a commit to Arctuition/packages-arc that referenced this pull request Jun 14, 2024
…ders of TreeView (flutter#6864)

This PR adds generics to the callbacks and builders of the TreeView widget. This removes the need to type cast the content of a TreeViewNode.

Fixes flutter/flutter#149656
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[two_dimensional_scrollables] Add generics to the callbacks and builders of TreeView
3 participants