Commit bf6ae3ee authored by Ian Hickson's avatar Ian Hickson

Reenable the gallery smoke test (#4303)

...and fix some grid and table intrinsic issues it uncovered.
parent 9e9dfc3d
...@@ -109,6 +109,5 @@ void main() { ...@@ -109,6 +109,5 @@ void main() {
await tester.tap(find.text('Light')); await tester.tap(find.text('Light'));
await tester.pump(); await tester.pump();
await tester.pump(const Duration(seconds: 1)); // Wait until it's changed. await tester.pump(const Duration(seconds: 1)); // Wait until it's changed.
}, });
skip: true);
} }
...@@ -292,6 +292,10 @@ abstract class GridDelegateWithInOrderChildPlacement extends GridDelegate { ...@@ -292,6 +292,10 @@ abstract class GridDelegateWithInOrderChildPlacement extends GridDelegate {
/// A [GridDelegate] that divides the grid's width evenly for a fixed number of columns. /// A [GridDelegate] that divides the grid's width evenly for a fixed number of columns.
///
/// Grids using this delegate cannot validly be placed inside an unconstrained
/// horizontal space, since they attempt to divide the incoming horizontal
/// maximum width constraint.
class FixedColumnCountGridDelegate extends GridDelegateWithInOrderChildPlacement { class FixedColumnCountGridDelegate extends GridDelegateWithInOrderChildPlacement {
/// Creates a grid delegate that uses a fixed column count. /// Creates a grid delegate that uses a fixed column count.
/// ///
...@@ -349,7 +353,17 @@ class FixedColumnCountGridDelegate extends GridDelegateWithInOrderChildPlacement ...@@ -349,7 +353,17 @@ class FixedColumnCountGridDelegate extends GridDelegateWithInOrderChildPlacement
return 0.0; return 0.0;
} }
// TODO(ianh): Provide efficient intrinsic height functions. @override
double getMinIntrinsicHeight(double width, int childCount) {
// TODO(ianh): Strictly, this should examine the children.
return 0.0;
}
@override
double getMaxIntrinsicHeight(double width, int childCount) {
// TODO(ianh): Strictly, this should examine the children.
return 0.0;
}
} }
/// A [GridDelegate] that fills the width with a variable number of tiles. /// A [GridDelegate] that fills the width with a variable number of tiles.
......
...@@ -892,7 +892,6 @@ class RenderTable extends RenderBox { ...@@ -892,7 +892,6 @@ class RenderTable extends RenderBox {
if (flexes[x] != null) { if (flexes[x] != null) {
final double newWidth = widths[x] - deficit * flexes[x] / totalFlex; final double newWidth = widths[x] - deficit * flexes[x] / totalFlex;
assert(newWidth.isFinite); assert(newWidth.isFinite);
assert(newWidth >= 0.0);
if (newWidth <= minWidths[x]) { if (newWidth <= minWidths[x]) {
// shrank to minimum // shrank to minimum
deficit -= widths[x] - minWidths[x]; deficit -= widths[x] - minWidths[x];
...@@ -904,6 +903,7 @@ class RenderTable extends RenderBox { ...@@ -904,6 +903,7 @@ class RenderTable extends RenderBox {
widths[x] = newWidth; widths[x] = newWidth;
newTotalFlex += flexes[x]; newTotalFlex += flexes[x];
} }
assert(widths[x] >= 0.0);
} }
} }
totalFlex = newTotalFlex; totalFlex = newTotalFlex;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment