Skip to content

Commit dbe24c9

Browse files
committed
GridView Fixes:
* Fix SizeFit applicability checks were incorrect. * Fix GridView LayoutModel not accounting for margin and padding.
1 parent 159ce61 commit dbe24c9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/src/api/nodes/grid_view_node.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class GridViewNode extends SinglePlaceholderNode
8484

8585
/// Calculates the fixed main axis extent of any child in the grid.
8686
double calculateMainAxisExtent(
87-
AxisC axis,
87+
AxisC mainAxis,
8888
SizeC size, [
8989
double? crossAxisExtent,
9090
]) {
@@ -99,10 +99,10 @@ class GridViewNode extends SinglePlaceholderNode
9999
}
100100

101101
/// Calculates the fixed cross axis extent of any child in the grid.
102-
double calculateCrossAxisExtent(AxisC axis, SizeC size) {
102+
double calculateCrossAxisExtent(AxisC mainAxis, SizeC size) {
103103
// Total cross axis space available for the grid view.
104104
final double totalCrossAxisSize =
105-
axis.opposite.isHorizontal ? size.width : size.height;
105+
mainAxis.opposite.isHorizontal ? size.width : size.height;
106106

107107
switch (properties.gridDelegate) {
108108
case FixedCrossAxisCountGridDelegateProperties prop:

lib/src/api/utils.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ abstract class ITextSizeCalculator {
4949

5050
/// Returns the line height of a single line of text.
5151
double getLineHeight();
52+
53+
/// Disposes of this calculator.
54+
void dispose();
5255
}
5356

5457
/// Defines different styling options for a widget.

0 commit comments

Comments
 (0)