-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Frustrations with DataTable
#151005
Comments
@nate-thegrate is there a specific feature or bug that this issue is covering? I am not sure what PR we could raise to resolve it as it is. :)
This is because the DataTable is not designed for scrolling. It is a box widget as opposed to a sliver, and will lay out all of its content rather than optimizing for what is currently visible. The TableView widget in the two_dimensional_scrollables package could help. It can scroll in 2D, but you can also use it to build a lazy 1D scrolling table.
What is the exception? There are multiple material widgets that existed before M3 and have not been updated since they are not part of the M3 spec. |
At one point, I decided to read through the full widget index, and my conclusion was that This issue was intended more along the lines of the dart-lang request template, i.e. describing a problem without any proposal for a solution. Perhaps I'll be able to refer to it a few months down the line. Thanks for taking the time to read it over; I'm good with marking this as P3 if that's good with you. |
It is not. DataTable implements the original Material Design.
I am still not sure what the problem is though. Can you explain? |
That's a good point; I apologize for misspeaking earlier. I think it would be more accurate to say "out of all the widgets in the Material library, DataTable is, by a significant margin, the most different from any Material 3 component." My problems with DataTable are entirely subjective: on multiple occasions I've tried adding one to an app and found the lack of customizability very frustrating. Instead of a border, columns are separated using 56-pixel-wide blank space by default. That, combined with its lack of scrolling optimization, makes it stick out to me as a widget that isn't suitable for mobile apps. Thanks for letting me know about the TableView widget; it appears to address all of DataTable's shortcomings, so I'm excited to learn more about it. At this point, it's clear to me that a GitHub issue was not the appropriate place to vent these frustrations; I probably should have shared this on Reddit or Discord instead. |
Just thought of something! |
This PR resolves [some problems I was having with `DataTable`](#151005), based on advice from the style guide: > ### Answer your own questions straight away > If you find yourself asking a question about our systems, please place whatever answer you subsequently discover into the documentation in the same place where you first looked for the answer. That way, the documentation will consist of answers to real questions, where people would look to find them. The `DataTable` documentation now specifies that the widget is based on the Material 2 spec, and it offers a list of useful alternatives. <br> Additionally, an item in the "See also" section was updated to use a reliable Go link: ```diff - /// * <https://material.io/design/components/data-tables.html> /// * <https://material.io/go/design-data-tables> ```
This PR resolves [some problems I was having with `DataTable`](flutter#151005), based on advice from the style guide: > ### Answer your own questions straight away > If you find yourself asking a question about our systems, please place whatever answer you subsequently discover into the documentation in the same place where you first looked for the answer. That way, the documentation will consist of answers to real questions, where people would look to find them. The `DataTable` documentation now specifies that the widget is based on the Material 2 spec, and it offers a list of useful alternatives. <br> Additionally, an item in the "See also" section was updated to use a reliable Go link: ```diff - /// * <https://material.io/design/components/data-tables.html> /// * <https://material.io/go/design-data-tables> ```
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
There was a lot of pagination back in the good old days, but modern apps have transitioned to use infinite scrolling.
ListTile
Flutter list tiles are fantastic—instead of just a single class, the material library also supplies
AboutListTile
,CheckboxListTile
,RadioListTile
, andSwitchListTile
, each with their ownonTap
configuration.DataTable
Conversely, it's impossible to set an
onTap
callback for aDataRow
.There's an
onLongPress
option, but the only way to have a callback for a tap is to useonSelectChanged
, which automatically adds a column of checkboxes. And there's no option to wrap with anInkWell
orGestureDetector
, sinceDataRow
isn't a widget.I'm currently working with a nonprofit to make a Flutter app. My friend @ChaAbby went to the effort of implementing a
DataTable
, only to discover that its performance drops off quickly as it grows in length. We'll have to either scrap it and switch to aCustomScrollView
, or use the paginated version and work with a user interface that belongs in the previous decade.Every widget in the Material library applies to a Material 3 component, with one exception.
If we end up implementing something along the lines of #143499 for older widgets, it should also apply to
DataTable
.The text was updated successfully, but these errors were encountered: