Skip to content

Conversation

@amanv8060
Copy link
Contributor

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

  • 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.
  • All existing and new tests are passing.

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

@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Mar 12, 2022
@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 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.

@amanv8060
Copy link
Contributor Author

amanv8060 commented Mar 13, 2022

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?
Also will add tests for scroll_controller scrolling.
Thanks.

@HansMuller HansMuller changed the title Exposed controller Exposed controller for PaginatedDataTable Mar 18, 2022
@HansMuller HansMuller changed the title Exposed controller for PaginatedDataTable Expose controller for PaginatedDataTable Mar 18, 2022
@HansMuller HansMuller requested a review from Piinks March 18, 2022 22:01
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 @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!

@amanv8060
Copy link
Contributor Author

Sure, will try to do it this weekend.

@amanv8060
Copy link
Contributor Author

@Piinks I have added the tests for

  • if psc gets attached
  • if we can scroll the data table through controller

Comment on lines 1082 to 1094
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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?

Copy link
Contributor Author

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 Piinks added the f: scrolling Viewports, list views, slivers, etc. label Apr 7, 2022
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.

LGTM! Thank you!

@Piinks
Copy link
Contributor

Piinks commented Apr 27, 2022

This will need a second review, I have sought one out.

@fluttergithubbot fluttergithubbot merged commit 0ff0aff into flutter:master May 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 9, 2022
@amanv8060 amanv8060 deleted the 99547 branch May 9, 2022 20:55
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request May 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request May 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: material design flutter/packages/flutter/material repository. f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PaginatedDataTable does not expose the scroll controller of the SingleChildScrollView that wraps its content

4 participants