Commit 844cf1fa authored by Andrew Wilson's avatar Andrew Wilson

Merge pull request #1131 from apwilson/shrinkwrap

Shrink wrap when constraints are infinite.
parents 0c4a86a9 380cfb26
...@@ -194,8 +194,9 @@ class RenderPositionedBox extends RenderShiftedBox { ...@@ -194,8 +194,9 @@ class RenderPositionedBox extends RenderShiftedBox {
markNeedsLayout(); markNeedsLayout();
} }
bool get _shinkWrapWidth => _shrinkWrap == ShrinkWrap.width || _shrinkWrap == ShrinkWrap.both; // These are only valid during performLayout() and paint(), since they rely on constraints which is only set after layout() is called.
bool get _shinkWrapHeight => _shrinkWrap == ShrinkWrap.height || _shrinkWrap == ShrinkWrap.both; bool get _shinkWrapWidth => _shrinkWrap == ShrinkWrap.width || _shrinkWrap == ShrinkWrap.both || constraints.maxWidth == double.INFINITY;
bool get _shinkWrapHeight => _shrinkWrap == ShrinkWrap.height || _shrinkWrap == ShrinkWrap.both || constraints.maxHeight == double.INFINITY;
void performLayout() { void performLayout() {
if (child != null) { if (child != null) {
......
import 'package:sky/widgets.dart';
import 'package:test/test.dart';
import 'widget_tester.dart';
void main() {
test('Can be placed in an infinte box', () {
WidgetTester tester = new WidgetTester();
tester.pumpFrame(() {
return new Block([new Center()]);
});
});
}
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