maxim-saplin / data_table_2

In-place substitute for Flutter's DataTable and PaginatedDataTable with fixed/sticky header and extra features
https://pub.dev/packages/data_table_2
BSD 3-Clause "New" or "Revised" License
203 stars 140 forks source link

Gradient for fixed column, data cell and fixed row #219

Open a15056478 opened 1 year ago

a15056478 commented 1 year ago

We can use only color property for row, column and cell. But we can't achieve gradient for data cell, fixed row or column. This could be a good feature which makes the table look much better. Is there any way to achieve this functionality?

maxim-saplin commented 1 year ago

Hi, in fact you can achieve gradient color for a data cell (not header or checkbox) via putting a Container as a child of data cell, setting its alignment to centre (to stretch it) and setting decoration. Though in this case there will be vertical spaces between cells

maxim-saplin commented 1 year ago

I've added a new branch cell_decroation, will work on it slowly, the idea is:

hendricgc commented 1 year ago

+1, really need this to my project

Hi, in fact you can achieve gradient color for a data cell (not header or checkbox) via putting a Container as a child of data cell, setting its alignment to centre (to stretch it) and setting decoration. Though in this case there will be vertical spaces between cells

I personally tested this workaround here. Of course it's possible, but when you are using some properties like columnSpacing or horizontalMargin, it may be kinda verbose to set zero to them and handle in the code synchronizing these spaces between the headers and cells. So, it can simplify a lot.

maxim-saplin commented 1 year ago

columnSpacing or horizontalMargin

Though some peeople might want those fields affecting the backgrouds of cells... That's one of the tradeoffs I am not sure about. Either leave the widget as is and suggest going with Containers in cells and be expilict with each cell looks or introduce 10 more new fields to the widget that will be used to impilictly apply some (complicated) logic to the looks of differents cells across the widegst (column, row, header, fixed columns etc.)