-
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
Material DataTable: added support of setting table row border thickness #49692
Material DataTable: added support of setting table row border thickness #49692
Conversation
using Theme.dividerTheme.thickness or, if the theme contains null-value - the value of DataTable._defaultBodrerThickness constant which was introduced to provide more meaningful value instead of using nameless double.
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 @dratushnyy welcome! 🎉 Thank you for the contribution and for writing a test!
I think this change looks ok, although @HansMuller may have some thoughts here. Particularly regarding www.flutter.dev/go/material-theme-system-updates
For now, it would safer to just add DataTable.dividerThickness, and not to defer to the dividerTheme. As Kate mentioned, we're moving toward a theme system where there's an overall theme with a small number of properties, and component specific themes. |
constructor parameter instead of using ThemeData during to upcoming (and possibly breaking) changes to Material Theme System.
@Piinks, @HansMuller Thank you for your comments, I updated the pull-request accordingly |
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 is looking good, just some small stuff.
field from 'borderThickness' to 'dividerThickness'. Refactored related unit tests: simplify the creation of test data table
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 LGTM @dratushnyy, with one tiny nit below. Thank you for the contribution.
It also looks like your branch contains a flake that is causing the customer_*
checks to fail. This is unrelated to your change, and should be resolved if you update your branch with changes from master. :)
Co-Authored-By: Kate Lovett <katelovett@google.com>
Looks like a trival trailing whitespace error needs to be fixed:
|
strings for `dividerThinkess` property
@HansMuller fixed. Sorry for the formatting issues. |
It looks like this branch still needs to be updated to resolve the failing checks. :) |
Thanks for the update! :) |
Description
At the current moment, there is no option in the
DataTable
widget to setup row thickness since the value of it is hardcoded and set to1.0
(please refer to the related issue for more detailed description).This pull request introduced changes fixing the issue, namely, try to use
Theme.of(context).dividerTheme.thickness
and if it isnull
then use a default value of1.0
which was moved to a named constant insideDataTable
class to increase code readability.Related Issues
Fixes #49691
Tests
I added the following tests:
DataTable set border width test
intopackages\flutter\test\material\data_table_test.dart
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze --flutter-repo
) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.