Closed wer-mathurin closed 7 months ago
This behavior (invisible arrow taking space) ensure that text is not moved when sorting is applied and arrow is displayed. It follows the behavior of standard Flutter data table.
In your case as a workaround not requiring widget code change can be pusplaying empty fixed width widget to the right.
@maxim-saplin Fair enough..
Would you consider adding a feature in the datacolumn2: an alignment property?
This can reduce the boilerplate code required to achieve this.
I will propose to the flutter framework, but the chances of having it rapidly is low...even if I provide a PR for this.
BTW, I will provide a PR if you agree that can be a nice addition.
Thanks for considering.
Thanks. Happy to review the PR
@maxim-saplin See the PR
Use case: We defined a table with the option
sortArrowAlwaysVisible: false,
the default. We want to center the header and we can't really center it. When you center the rows under the column this is disturbing.This is cause by a always rendered invisible "Arrow" + SizedBox.... in the Data_table_2.dart file at line 422-431
One possible fix can be ===>
AND
Change the _SortArrawState build method to use the Visibility widget from the framework This way when the visibility is set to false, the component take 0px
This way the sort arrow is not there the title is really center (when you want it to be center). From my perspective this is not a breaking change, but rather an improvement in term of layout expectation.