-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
In the following code, the second Placeholder is assigned to the first row, even though the row is not wide enough to hold it. This causes a FlutterError ("GridPlacement.columnEnd cannot exceed column count"). There is enough space for all of the Placeholders if they are laid out vertically.
LayoutGrid(
columnSizes: repeat(3, [50.px]),
rowSizes: repeat(5, [50.px]),
autoPlacement: AutoPlacement.rowSparse,
children: [
for (int i = 0; i < 4; i++)
Placeholder().withGridPlacement(columnSpan: 2),
],
);Note that this code works fine (columns increased to 4), since the second Placeholder takes up exactly as much space as is left in the row, so the next placeholder can layout properly.
LayoutGrid(
columnSizes: repeat(4, [50.px]),
rowSizes: repeat(5, [50.px]),
autoPlacement: AutoPlacement.rowSparse,
children: [
for (int i = 0; i < 4; i++)
Placeholder().withGridPlacement(columnSpan: 2),
],
);Metadata
Metadata
Assignees
Labels
No labels