@@ -38,20 +38,20 @@ Widget _layoutCells(RenderContext context, BoxConstraints constraints) {
38
38
if (colWidth != null && colWidth.endsWith ("%" )) {
39
39
if (! constraints.hasBoundedWidth) {
40
40
// In a horizontally unbounded container; always wrap content instead of applying flex
41
- return IntrinsicContentTrackSize ();
41
+ return const IntrinsicContentTrackSize ();
42
42
}
43
43
final percentageSize =
44
44
double .tryParse (colWidth.substring (0 , colWidth.length - 1 ));
45
45
return percentageSize != null && ! percentageSize.isNaN
46
46
? FlexibleTrackSize (percentageSize * 0.01 )
47
- : IntrinsicContentTrackSize ();
47
+ : const IntrinsicContentTrackSize ();
48
48
} else if (colWidth != null ) {
49
49
final fixedPxSize = double .tryParse (colWidth);
50
50
return fixedPxSize != null
51
51
? FixedTrackSize (fixedPxSize)
52
- : IntrinsicContentTrackSize ();
52
+ : const IntrinsicContentTrackSize ();
53
53
} else {
54
- return IntrinsicContentTrackSize ();
54
+ return const IntrinsicContentTrackSize ();
55
55
}
56
56
});
57
57
})
@@ -66,7 +66,7 @@ Widget _layoutCells(RenderContext context, BoxConstraints constraints) {
66
66
67
67
// All table rows have a height intrinsic to their (spanned) contents
68
68
final rowSizes =
69
- List .generate (rows.length, (_) => IntrinsicContentTrackSize ());
69
+ List .generate (rows.length, (_) => const IntrinsicContentTrackSize ());
70
70
71
71
// Calculate column bounds
72
72
int columnMax = 0 ;
@@ -103,6 +103,10 @@ Widget _layoutCells(RenderContext context, BoxConstraints constraints) {
103
103
columnColspanOffset[columni].clamp (1 , columnMax - columni - 1 );
104
104
}
105
105
cells.add (GridPlacement (
106
+ columnStart: columni,
107
+ columnSpan: min (child.colspan, columnMax - columni),
108
+ rowStart: rowi,
109
+ rowSpan: min (child.rowspan, rows.length - rowi),
106
110
child: CssBoxWidget (
107
111
style: child.style
108
112
.merge (row.style), //TODO padding/decoration(color/border)
@@ -118,10 +122,6 @@ Widget _layoutCells(RenderContext context, BoxConstraints constraints) {
118
122
),
119
123
),
120
124
),
121
- columnStart: columni,
122
- columnSpan: min (child.colspan, columnMax - columni),
123
- rowStart: rowi,
124
- rowSpan: min (child.rowspan, rows.length - rowi),
125
125
));
126
126
columnRowOffset[columni] = child.rowspan - 1 ;
127
127
columnColspanOffset[columni] = child.colspan;
@@ -138,11 +138,11 @@ Widget _layoutCells(RenderContext context, BoxConstraints constraints) {
138
138
// Create column tracks (insofar there were no colgroups that already defined them)
139
139
List <TrackSize > finalColumnSizes = columnSizes.take (columnMax).toList ();
140
140
finalColumnSizes += List .generate (max (0 , columnMax - finalColumnSizes.length),
141
- (_) => IntrinsicContentTrackSize ());
141
+ (_) => const IntrinsicContentTrackSize ());
142
142
143
143
if (finalColumnSizes.isEmpty || rowSizes.isEmpty) {
144
144
// No actual cells to show
145
- return SizedBox ();
145
+ return const SizedBox ();
146
146
}
147
147
148
148
return LayoutGrid (
0 commit comments