Don't crash if no widthFactor is set in an unbounded context
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
@@ -21,4 +22,26 @@ void main() {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
test('Shrink wraps in finite space', () {
|
||||
testWidgets((WidgetTester tester) {
|
||||
GlobalKey alignKey = new GlobalKey();
|
||||
tester.pumpWidget(
|
||||
new ScrollableViewport(
|
||||
child: new Align(
|
||||
key: alignKey,
|
||||
child: new Container(
|
||||
width: 10.0,
|
||||
height: 10.0
|
||||
),
|
||||
alignment: const FractionalOffset(0.50, 0.50)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
RenderBox box = alignKey.currentContext.findRenderObject();
|
||||
expect(box.size.width, equals(800.0));
|
||||
expect(box.size.height, equals(10.0));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user