Closed dsyrstad closed 2 years ago
I think have I found a fix for this. This line does not consider the gaps in the min/max sizes: https://github.com/shyndman/flutter_layout_grid/blob/bcf4206a10c857d77ee0bbf31daa4cf4bff3f193/lib/src/rendering/layout_grid.dart#L524
Changing the line to:
var axisMinSize = totalGapAlongAxis, axisMaxSize = totalGapAlongAxis;
seems to fix the issue. The tests pass, but I'm not sure if it is a solid fix. I can raise a PR if you'd like.
I just went ahead and opened PR #84. All of the tests (including a new one) pass and the examples seem to work fine.
Wonderful! Thank you @dsyrstad
I'll get that merged right away.
Published as v2.0.1
In this example: https://gist.github.com/dsyrstad/ecc79ed05f25a462476ea414812158f2 I have two nested grids which use
auto
-sized rows and row gaps. The inner grid overflows the outer grid's cell by the exact amount of the row gap:It overflows by exactly the
InnerGrid
rowGap
(10) * 2 (two gaps). Notice that whenInnerGrid
is not nested (bottom of screenshot), it does not overflow.If I change the
InnerGrid
rowGap to zero, it no longer overflows:Note that the
rowGap
onOuterGrid
is simply there so you can seeRow 3
overflowing into the gap.I'm using
flutter_layout_grid
2.0.0 and Flutter 2.10.5. The problem is reproducible on all platforms that I've tried (Linux desktop, web, and Android).