-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Paginated Data Table : Fixed Row number at footer in last page #130389
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. |
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.
Hi @aakash-pamnani! Welcome, and thanks for contributing. It looks like this PR is addressing two separate issues. Can you split them up into separate PRs? Thank you!
| log.clear(); | ||
| }); | ||
|
|
||
| testWidgets('PaginatedDataTable fotter page number', (WidgetTester tester) async { |
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.
| testWidgets('PaginatedDataTable fotter page number', (WidgetTester tester) async { | |
| testWidgets('PaginatedDataTable footer page number', (WidgetTester tester) async { |
| localizations.pageRowsInfoTitle( | ||
| _firstRowIndex + 1, | ||
| _firstRowIndex + widget.rowsPerPage, | ||
| (_firstRowIndex + widget.rowsPerPage) > _rowCount ? _rowCount : (_firstRowIndex + widget.rowsPerPage), |
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.
Can you split this out into a separate pull request? Trying to fix multiple things with this widget is great! However, it would be a shame if one part of this PR was reverted because the other part created an unforeseen issue. :)
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 will create a new PR for the new parameters, I didn't thought about this. Thanks
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.
Could this be a min function?
| (_firstRowIndex + widget.rowsPerPage) > _rowCount ? _rowCount : (_firstRowIndex + widget.rowsPerPage), | |
| math.min(_firstRowIndex + widget.rowsPerPage, _rowCount), |
|
Hi @Piinks I have removed one fix from this PR, will create a new PR once the test's are ready. |
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.
Thank you for the update! I think just a small tweak below - using a min function is probably a bit more reader friendly. :)
|
Done |
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.
Someone in #80421 commented that "The toolbar is then halfway down the page instead of at the bottom of the page." And that does not meet the material design standards. |
justinmc
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 👍
There was a test failure but it seems to be an infrastructure problem, so I've rerun it.
|
|
||
| expect(find.text('497–500 of 500'), findsOneWidget); | ||
|
|
||
|
|
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.
Remove this extra newline here.
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 @justinmc, removed the newline.
flutter/flutter@436df69...f4c25bb 2023-08-09 [email protected] Revert "Handle breaking changes in leak_tracker." (flutter/flutter#132223) 2023-08-09 [email protected] Roll Flutter Engine from 8ec575168d44 to 3d3fb4faed02 (3 revisions) (flutter/flutter#132193) 2023-08-09 [email protected] Use pattern matching to avoid strange type annotations (flutter/flutter#131964) 2023-08-09 [email protected] Roll Flutter Engine from 6839b88283b6 to 8ec575168d44 (1 revision) (flutter/flutter#132182) 2023-08-09 [email protected] Roll Flutter Engine from 29b117aa4192 to 6839b88283b6 (1 revision) (flutter/flutter#132181) 2023-08-09 [email protected] Roll Flutter Engine from 82292b8390cb to 29b117aa4192 (5 revisions) (flutter/flutter#132179) 2023-08-09 [email protected] Add more info to `OverlayState.insert` error messages (flutter/flutter#129363) 2023-08-08 [email protected] Add `textCapitalization` property for `SearchBar` and `SearchAnchor` (flutter/flutter#131459) 2023-08-08 [email protected] Roll Flutter Engine from 934ebb005d02 to 82292b8390cb (3 revisions) (flutter/flutter#132166) 2023-08-08 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.21.2 to 2.21.3 (flutter/flutter#132165) 2023-08-08 [email protected] Revert of #120385 (flutter/flutter#132167) 2023-08-08 [email protected] Add `PopupMenuButton.iconColor`, `PopupMenuTheme.iconSize` and fix button icon using unexpected color propert (flutter/flutter#132054) 2023-08-08 [email protected] More PageStorage clarity in the documentation (flutter/flutter#131954) 2023-08-08 [email protected] Document that missed_frame_build_budget_count is misleading (flutter/flutter#132137) 2023-08-08 [email protected] Locate the template directory using a TemplatePathProvider. (flutter/flutter#132156) 2023-08-08 [email protected] Roll Flutter Engine from dd03fae51d38 to 934ebb005d02 (4 revisions) (flutter/flutter#132159) 2023-08-08 [email protected] Roll Flutter Engine from 22bd35a19352 to dd03fae51d38 (3 revisions) (flutter/flutter#132149) 2023-08-08 [email protected] Fix `TabBarTheme.indicatorColor` not applied in Material 2 (flutter/flutter#132123) 2023-08-08 [email protected] Paginated Data Table : Fixed Row number at footer in last page (flutter/flutter#130389) 2023-08-08 [email protected] [web] Use benchmark callback from `dart:ui_web` (flutter/flutter#132087) 2023-08-08 [email protected] Roll Flutter Engine from 99fdac88f3c6 to 22bd35a19352 (3 revisions) (flutter/flutter#132141) 2023-08-08 [email protected] [framework] Add Search Web to selection controls for iOS (flutter/flutter#131898) 2023-08-08 [email protected] Remove Iterator from _History (flutter/flutter#132101) 2023-08-08 [email protected] Update dartdoc driver to match current behaviour (flutter/flutter#132078) 2023-08-08 [email protected] More documentation about warm-up frames (flutter/flutter#132085) 2023-08-08 [email protected] Roll Flutter Engine from 146c4c9487fc to 99fdac88f3c6 (3 revisions) (flutter/flutter#132135) 2023-08-08 [email protected] Roll Packages from d7ee75a to ac41376 (8 revisions) (flutter/flutter#132133) 2023-08-08 [email protected] Handle breaking changes in leak_tracker. (flutter/flutter#131998) 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 Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Fixed the row count in the footer.
Before

After

Issues Resolved
Fixes #116569
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.