Merge pull request #2248 from Hixie/size-obs-10
SizeObserver crusade: The Last Test
This commit is contained in:
commit
15e9b95d19
@ -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)));
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user