-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Expose controller for PaginatedDataTable #100005
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
Conversation
|
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 Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on 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. |
|
I don't think that primary is required, or should I add it as well or write a manual comment instead of using the template? |
Piinks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @amanv8060! Thanks for the contribution.
I think adding primary as well here will be beneficial to the goal the issue is describing. It is the PrimaryScrollController (PSC) that the default keyboard shortcuts check to see if they can activate any scrolling actions, so both controller and primary sound like reasonable additions here.
Fun fact, in #99547, the PSC does not kick in automatically because the PSC only automatically attaches to vertical scroll views. 😉
Let me know if you need guidance for adding tests. Thanks!
|
Sure, will try to do it this weekend. |
|
@Piinks I have added the tests for
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not actually verify which scrollable used the scroll controller, like the other test below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we never pass the controller to the second scrollable(footer), can we safely assume that it is always DataTable that uses the provided ScrollController?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a great question! I imagine it is possible the user may want access to one controller or the other at some point. Does the issue specify which scrollable is needed for access? If so, it may require we have clearer parameters here that indicate which controller this is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue mentions that it needs controller for contents of PaginatedDataTable. I assume that it is for main content.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Piinks, Should I expose both the controllers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure, if the issue is not clear we should ask the person that filed it for clarity. We shouldn't assume t know what they mean. Can you ask in the issue you are trying to resolve?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I did ask and the author only needs the controller for DataTable.
Piinks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
|
This will need a second review, I have sought one out. |
Exposes controller for PaginatedDataTable
fixes #99547
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.