Merge pull request #1517 from yjbanov/overflow-box-debugFillDescription-1487
add debugFillDescription to OverflowBox
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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',
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user