Commit d7bc93b7 authored by Hixie's avatar Hixie

SizeObserver crusade: The Last Test

parent b18047bf
......@@ -10,7 +10,6 @@ import 'package:test/test.dart';
void main() {
test('FractionallySizedBox', () {
testWidgets((WidgetTester tester) {
Size detectedSize;
GlobalKey inner = new GlobalKey();
tester.pumpWidget(new OverflowBox(
minWidth: 0.0,
......@@ -22,19 +21,14 @@ void main() {
child: new FractionallySizedBox(
width: 0.5,
height: 0.25,
child: new SizeObserver(
onSizeChanged: (Size size) {
detectedSize = size;
},
child: new Container(
key: inner
)
child: new Container(
key: inner
)
)
)
));
expect(detectedSize, equals(const Size(50.0, 25.0)));
RenderBox box = inner.currentContext.findRenderObject();
expect(box.size, equals(const Size(50.0, 25.0)));
expect(box.localToGlobal(Point.origin), equals(const Point(25.0, 37.5)));
});
});
......
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