add debugFillDescription to OverflowBox

This commit is contained in:
yjbanov
2016-02-01 18:28:04 -08:00
parent 3abb8c4ec9
commit 4c823cdb97
2 changed files with 28 additions and 0 deletions

View File

@@ -655,6 +655,18 @@ class OverflowBox extends OneChildRenderObjectWidget {
..maxHeight = maxHeight
..alignment = alignment;
}
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
if (minWidth != null)
description.add('minWidth: $minWidth');
if (maxWidth != null)
description.add('maxWidth: $maxWidth');
if (minHeight != null)
description.add('minHeight: $minHeight');
if (maxHeight != null)
description.add('maxHeight: $maxHeight');
}
}
class SizedOverflowBox extends OneChildRenderObjectWidget {

View File

@@ -32,4 +32,20 @@ void main() {
expect(box.size, equals(const Size(100.0, 50.0)));
});
});
test('OverflowBox implements debugFillDescription', () {
List<String> description = <String>[];
new OverflowBox(
minWidth: 1.0,
maxWidth: 2.0,
minHeight: 3.0,
maxHeight: 4.0
).debugFillDescription(description);
expect(description, [
'minWidth: 1.0',
'maxWidth: 2.0',
'minHeight: 3.0',
'maxHeight: 4.0',
]);
});
}