Skip to content
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

feat: Column spans #1736

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

feat: Column spans #1736

wants to merge 3 commits into from

Conversation

Gustl22
Copy link

@Gustl22 Gustl22 commented Sep 8, 2024

Add's the colspan feature for table rows.

Closes #989, #896, #645, #313, #256, #167

@Gustl22 Gustl22 marked this pull request as ready for review September 8, 2024 15:01
@Gustl22
Copy link
Author

Gustl22 commented Sep 8, 2024

IntrinsicColumnWidth is not yet tested. Also I didn't get the whole concept, so there might be some edge cases, which I haven't considered (especially in the paint method, where _widths are consumed).

@DavBfr
Copy link
Owner

DavBfr commented Sep 9, 2024

Can you add a test?

@Gustl22
Copy link
Author

Gustl22 commented Sep 9, 2024

Sure, I just have limited resources and vacation soon, so if someone wants to finish up, I don't mind.
I'll get back to it in a few weeks.

@Gustl22 Gustl22 changed the title feat: Column spans (closes #313) feat: Column spans Sep 9, 2024
@Gustl22
Copy link
Author

Gustl22 commented Sep 14, 2024

I added a test, but it does not precisely check e.g. the different box properties.
If this should be also done, let me know and how to best approach it.

@Gustl22
Copy link
Author

Gustl22 commented Sep 19, 2024

I have a small problem: the tests now complain, that there's a difference (which is indeed in the renders).
But if I inspect this in a pdf viewer / firefox / chrome etc. There isn't any difference visisble:

diff-3
image

I suspect the test renderer interprets this as small gap and therefore outputs the mean as grey?
widgets-table.pdf

Should we ignore this or solve it another way?

@DavBfr
Copy link
Owner

DavBfr commented Sep 19, 2024

Yes, that's possible. Seems to be at the intersection of each cell.

@Gustl22
Copy link
Author

Gustl22 commented Sep 19, 2024

To allow col spans the border must be calculated for each cell and not for the whole width / height of the table any more. So there now exist infinite small fake gaps, which in theory should not be visible, and also aren't in my inspection in the pdf readers, just the pdftocairo does this I think...

@DavBfr
Copy link
Owner

DavBfr commented Sep 19, 2024

That's fine then.

@Gustl22
Copy link
Author

Gustl22 commented Sep 20, 2024

I now wonder, if it would make sense to introduce a new widget, like TableCell where one can define the col and row span. Otherwise I don't see a good way to support row spans in the future. Also this would remove potential errors in defining the col spans on the Row level.

See also:
flutter/packages#5917

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Please show interest in achieving row span and colspan like html in pdf table
2 participants