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
Fix DataTable example not being scrollable #131556
Conversation
The existing example has 10 items in DataTable, as all of them are already visible on the screen, writing a test for checking scrollability doesn't work, hence the items length was increased to 20. Does that work or should I do |
@@ -357,6 +358,11 @@ class DataCell { | |||
/// [PaginatedDataTable] which automatically splits the data into | |||
/// multiple pages. | |||
/// | |||
/// ## Performance considerations when wrapping [DataTable] with [SingleChildScrollView] | |||
/// | |||
/// Wrapping a [DataTable] with [SingleChildScrollView] is expensive as [SingleChildScrollView] |
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.
When flutter/packages#4536 lands, this could point to using TableView
instead?
cc @Piinks
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.
Yeah probably. :)
I would recommend adding some reference here to other options, not including TableView since that has not landed yet. If someone should not use a SingleChildScrollView because the table is very large, we should recommend PaginatedDataTable to split it up, or using a CustomScrollView.
TableView may not be relevant if someone only cares about scrolling in one direction, but we can add a reference to it when it is available.
20 items sound good to me. 👍 |
Anything else I need to do to ready this PR @TahaTesser |
The class string for this newly added test class needs to be removed from flutter/dev/bots/check_code_samples.dart Line 295 in bd64bf5
|
@@ -357,6 +357,11 @@ class DataCell { | |||
/// [PaginatedDataTable] which automatically splits the data into | |||
/// multiple pages. | |||
/// | |||
/// ## Performance considerations when wrapping [DataTable] with [SingleChildScrollView] |
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.
@Piinks Do you have any suggestions for this section?
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.
Just the comment below, we should provide an alternative recommendation. :)
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.
So, suggest using PaginatedDataTable
wherever possible?
Or is there a better alternative
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.
we should recommend PaginatedDataTable to split it up, or using a CustomScrollView.
I think those two would be the best recommendation for now. :)
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.
Now that TableRow is merged to master, should that be added as a recommendation?
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.
Let's just add the previously mentioned recommendations for now so we can land this PR. We'll likely do a sweep overall to see where we should be mentioning the TableView.
This comment was marked as spam.
This comment was marked as spam.
double minIntrinsicWidth(Iterable<RenderBox> cells, double containerWidth) => | ||
throw UnimplementedError(); |
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.
Looks like you've made some unintended format changes.
Please read https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#formatting
Please revert the format changes
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.
Fixed this
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.
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!
auto label is removed for flutter/flutter/131556, due to This PR has not met approval requirements for merging. Changes were requested by {TahaTesser}, please make the needed changes and resubmit this PR.
|
The autosubmit bot is wrong here, filed #134477 |
flutter/flutter@219efce...4e7a07a 2023-09-12 katelovett@google.com Remove chip tooltip deprecations (flutter/flutter#134486) 2023-09-12 engine-flutter-autoroll@skia.org Roll Flutter Engine from 8a8ddaeecf8a to d4698c65aa8d (2 revisions) (flutter/flutter#134553) 2023-09-12 katelovett@google.com Remove deprecated TextSelectionOverlay.fadeDuration (flutter/flutter#134485) 2023-09-12 engine-flutter-autoroll@skia.org Roll Flutter Engine from 25be03186d82 to 8a8ddaeecf8a (1 revision) (flutter/flutter#134545) 2023-09-12 engine-flutter-autoroll@skia.org Roll Packages from ef0c65e to e04ba88 (5 revisions) (flutter/flutter#134546) 2023-09-12 47866232+chunhtai@users.noreply.github.com Revert "Adds a parent scope TraversalEdgeBehavior and fixes modal rou� (flutter/flutter#134550) 2023-09-12 fluttergithubbot@gmail.com Marks Windows_android channels_integration_test_win to be unflaky (flutter/flutter#133129) 2023-09-12 engine-flutter-autoroll@skia.org Roll Flutter Engine from 4091167e402d to 25be03186d82 (1 revision) (flutter/flutter#134536) 2023-09-12 engine-flutter-autoroll@skia.org Roll Flutter Engine from 54175da7ba90 to 4091167e402d (1 revision) (flutter/flutter#134532) 2023-09-12 engine-flutter-autoroll@skia.org Roll Flutter Engine from 85f3f02e5c37 to 54175da7ba90 (2 revisions) (flutter/flutter#134531) 2023-09-12 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1369ab35aaa7 to 85f3f02e5c37 (1 revision) (flutter/flutter#134519) 2023-09-12 engine-flutter-autoroll@skia.org Roll Flutter Engine from 2f1efe5967f3 to 1369ab35aaa7 (1 revision) (flutter/flutter#134512) 2023-09-12 engine-flutter-autoroll@skia.org Roll Flutter Engine from 4d8265cbc133 to 2f1efe5967f3 (3 revisions) (flutter/flutter#134511) 2023-09-12 engine-flutter-autoroll@skia.org Roll Flutter Engine from ee7215553deb to 4d8265cbc133 (1 revision) (flutter/flutter#134506) 2023-09-12 engine-flutter-autoroll@skia.org Roll Flutter Engine from 6ddee4423d2c to ee7215553deb (2 revisions) (flutter/flutter#134505) 2023-09-12 engine-flutter-autoroll@skia.org Roll Flutter Engine from a98348946d61 to 6ddee4423d2c (1 revision) (flutter/flutter#134490) 2023-09-12 xubaolin@oppo.com [New feature] Allowing the `ListView` slivers to have different extents while still having scrolling performance (flutter/flutter#131393) 2023-09-12 engine-flutter-autoroll@skia.org Roll Flutter Engine from 8389ad914b21 to a98348946d61 (4 revisions) (flutter/flutter#134487) 2023-09-12 kouhei.seino@woven-planet.global ScaleGestureRecognizer: make pointerCount public (flutter/flutter#127310) 2023-09-11 chinmay@blend.to Fix DataTable example not being scrollable (flutter/flutter#131556) 2023-09-11 engine-flutter-autoroll@skia.org Roll Flutter Engine from 06696e768c1b to 8389ad914b21 (2 revisions) (flutter/flutter#134469) 2023-09-11 christopherfujino@gmail.com [flutter_tools] disallow -O0 for flutter build web (flutter/flutter#134185) 2023-09-11 sokolovskyi.konstantin@gmail.com Cover focus tests with leak tracking (flutter/flutter#134457) 2023-09-11 engine-flutter-autoroll@skia.org Roll Flutter Engine from 0774ddcda9b0 to 06696e768c1b (4 revisions) (flutter/flutter#134462) 2023-09-11 sokolovskyi.konstantin@gmail.com Fix memory leak in RenderAnimatedSize (flutter/flutter#133653) 2023-09-11 engine-flutter-autoroll@skia.org Roll Flutter Engine from e42fd367adcb to 0774ddcda9b0 (1 revision) (flutter/flutter#134447) 2023-09-11 engine-flutter-autoroll@skia.org Roll Flutter Engine from d593002b7159 to e42fd367adcb (1 revision) (flutter/flutter#134444) 2023-09-11 engine-flutter-autoroll@skia.org Roll Packages from aaae5ef to ef0c65e (6 revisions) (flutter/flutter#134445) 2023-09-11 engine-flutter-autoroll@skia.org Roll Flutter Engine from 2b5961cbc40d to d593002b7159 (3 revisions) (flutter/flutter#134439) 2023-09-11 polinach@google.com Mark leak: instances of OpacityLayer, created by _RenderChip, should be disposed. (flutter/flutter#134395) 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 camillesimon@google.com,rmistry@google.com,stuartmorgan@google.com 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
Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.
Fixes #112755
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.