Commit f2ab841a authored by Jacob Richman's avatar Jacob Richman Committed by GitHub

Add DiagnosticLevel used to filter how verbose toStringDeep output for (#11995)

Diagnostics object is.
parent 2d949ab6
......@@ -26,7 +26,8 @@ export 'package:flutter/foundation.dart' show
VoidCallback,
ValueChanged,
ValueGetter,
ValueSetter;
ValueSetter,
DiagnosticLevel;
export 'package:vector_math/vector_math_64.dart' show Matrix4;
export 'src/rendering/animated_size.dart';
......
......@@ -234,7 +234,7 @@ class InkResponse extends StatefulWidget {
if (gestures.isEmpty)
gestures.add('<none>');
description.add(new IterableProperty<String>('gestures', gestures));
description.add(new DiagnosticsProperty<bool>('containedInkWell', containedInkWell, hidden: true));
description.add(new DiagnosticsProperty<bool>('containedInkWell', containedInkWell, level: DiagnosticLevel.fine));
description.add(new DiagnosticsProperty<BoxShape>(
'highlightShape',
highlightShape,
......
......@@ -521,7 +521,7 @@ class TextStyle extends Diagnosticable {
// Hide decorationColor from the default text view as it is shown in the
// terse decoration summary as well.
styles.add(new DiagnosticsProperty<Color>('${prefix}decorationColor', decorationColor, defaultValue: null, hidden: true));
styles.add(new DiagnosticsProperty<Color>('${prefix}decorationColor', decorationColor, defaultValue: null, level: DiagnosticLevel.fine));
if (decorationColor != null)
decorationDescription.add('$decorationColor');
......@@ -529,15 +529,15 @@ class TextStyle extends Diagnosticable {
// Intentionally collide with the property 'decoration' added below.
// Tools that show hidden properties could choose the first property
// matching the name to disambiguate.
styles.add(new DiagnosticsProperty<TextDecoration>('${prefix}decoration', decoration, defaultValue: null, hidden: true));
styles.add(new DiagnosticsProperty<TextDecoration>('${prefix}decoration', decoration, defaultValue: null, level: DiagnosticLevel.hidden));
if (decoration != null)
decorationDescription.add('$decoration');
assert(decorationDescription.isNotEmpty);
styles.add(new MessageProperty('${prefix}decoration', decorationDescription.join(' ')));
}
final bool styleSpecified = styles.any((DiagnosticsNode n) => !n.hidden);
properties.add(new DiagnosticsProperty<bool>('${prefix}inherit', inherit, hidden: !styleSpecified && inherit));
final bool styleSpecified = styles.any((DiagnosticsNode n) => !n.isFiltered(DiagnosticLevel.info));
properties.add(new DiagnosticsProperty<bool>('${prefix}inherit', inherit, level: (!styleSpecified && inherit) ? DiagnosticLevel.fine : DiagnosticLevel.info));
for (DiagnosticsNode style in styles)
properties.add(style);
......
......@@ -1667,7 +1667,7 @@ abstract class RenderBox extends RenderObject {
node = node.parent;
information.writeln('The nearest ancestor providing an unbounded width constraint is:');
information.write(' ');
information.writeln(node.toStringShallow('\n '));
information.writeln(node.toStringShallow(joiner: '\n '));
}
if (!constraints.hasBoundedHeight) {
RenderBox node = this;
......@@ -1675,7 +1675,7 @@ abstract class RenderBox extends RenderObject {
node = node.parent;
information.writeln('The nearest ancestor providing an unbounded height constraint is:');
information.write(' ');
information.writeln(node.toStringShallow('\n '));
information.writeln(node.toStringShallow(joiner: '\n '));
}
throw new FlutterError(
......@@ -2090,7 +2090,7 @@ abstract class RenderBox extends RenderObject {
@override
void debugFillProperties(DiagnosticPropertiesBuilder description) {
super.debugFillProperties(description);
description.add(new DiagnosticsProperty<Size>('size', _size, ifNull: 'MISSING'));
description.add(new DiagnosticsProperty<Size>('size', _size, missingIfNull: true));
}
}
......
......@@ -146,15 +146,19 @@ List<String> debugDescribeTransform(Matrix4 transform) {
class TransformProperty extends DiagnosticsProperty<Matrix4> {
/// Create a diagnostics property for [Matrix4] objects.
///
/// The [showName] argument must not be null.
/// The [showName] and [level] arguments must not be null.
TransformProperty(String name, Matrix4 value, {
bool showName: true,
Object defaultValue: kNoDefaultValue,
}) : assert(showName != null), super(
DiagnosticLevel level: DiagnosticLevel.info,
}) : assert(showName != null),
assert(level != null),
super(
name,
value,
showName: showName,
defaultValue: defaultValue,
level: level,
);
@override
......
......@@ -677,7 +677,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
if (node != null) {
information.writeln('The nearest ancestor providing an unbounded width constraint is:');
information.write(' ');
information.write(node.toStringShallow('\n '));
information.write(node.toStringShallow(joiner: '\n '));
}
information.writeln('See also: https://flutter.io/layout/');
addendum = information.toString();
......
......@@ -107,8 +107,8 @@ abstract class Layer extends AbstractNode with DiagnosticableTreeMixin {
@override
void debugFillProperties(DiagnosticPropertiesBuilder description) {
super.debugFillProperties(description);
description.add(new DiagnosticsProperty<Object>('owner', owner, hidden: parent != null, defaultValue: null));
description.add(new DiagnosticsProperty<dynamic>('creator', debugCreator, defaultValue: null));
description.add(new DiagnosticsProperty<Object>('owner', owner, level: parent != null ? DiagnosticLevel.hidden : DiagnosticLevel.info, defaultValue: null));
description.add(new DiagnosticsProperty<dynamic>('creator', debugCreator, defaultValue: null, level: DiagnosticLevel.debug));
}
}
......
......@@ -1470,7 +1470,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
renderObject: this,
informationCollector: (StringBuffer information) {
information.writeln('The following RenderObject was being processed when the exception was fired:');
information.writeln(' ${toStringShallow('\n ')}');
information.writeln(' ${toStringShallow(joiner: '\n ')}');
final List<String> descendants = <String>[];
const int maxDepth = 5;
int depth = 0;
......@@ -2326,7 +2326,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
'Tried to paint a RenderObject reentrantly.\n'
'The following RenderObject was already being painted when it was '
'painted again:\n'
' ${toStringShallow("\n ")}\n'
' ${toStringShallow(joiner: "\n ")}\n'
'Since this typically indicates an infinite recursion, it is '
'disallowed.'
);
......@@ -2349,7 +2349,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
'updated.\n'
'The following RenderObject was marked as having dirty compositing '
'bits at the time that it was painted:\n'
' ${toStringShallow("\n ")}\n'
' ${toStringShallow(joiner: "\n ")}\n'
'A RenderObject that still has dirty compositing bits cannot be '
'painted because this indicates that the tree has not yet been '
'properly configured for creating the layer tree.\n'
......@@ -2840,17 +2840,25 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
}
@override
String toString() => toStringShort();
String toString({ DiagnosticLevel minLevel }) => toStringShort();
/// Returns a description of the tree rooted at this node.
/// If the prefix argument is provided, then every line in the output
/// will be prefixed by that string.
@override
String toStringDeep({ String prefixLineOne: '', String prefixOtherLines: '' }) {
String toStringDeep({
String prefixLineOne: '',
String prefixOtherLines: '',
DiagnosticLevel minLevel: DiagnosticLevel.debug,
}) {
final RenderObject debugPreviousActiveLayout = _debugActiveLayout;
_debugActiveLayout = null;
final String result = super.toStringDeep(prefixLineOne: prefixLineOne, prefixOtherLines: prefixOtherLines);
final String result = super.toStringDeep(
prefixLineOne: prefixLineOne,
prefixOtherLines: prefixOtherLines,
minLevel: minLevel,
);
_debugActiveLayout = debugPreviousActiveLayout;
return result;
......@@ -2862,10 +2870,13 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
/// This includes the same information for this RenderObject as given by
/// [toStringDeep], but does not recurse to any children.
@override
String toStringShallow([String joiner = '; ']) {
String toStringShallow({
String joiner: '; ',
DiagnosticLevel minLevel: DiagnosticLevel.debug,
}) {
final RenderObject debugPreviousActiveLayout = _debugActiveLayout;
_debugActiveLayout = null;
final String result = super.toStringShallow(joiner);
final String result = super.toStringShallow(joiner: joiner, minLevel: minLevel);
_debugActiveLayout = debugPreviousActiveLayout;
return result;
}
......@@ -2873,9 +2884,9 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
@protected
@override
void debugFillProperties(DiagnosticPropertiesBuilder description) {
description.add(new DiagnosticsProperty<dynamic>('creator', debugCreator, defaultValue: null));
description.add(new DiagnosticsProperty<ParentData>('parentData', parentData, tooltip: _debugCanParentUseSize == true ? 'can use size' : null, ifNull: 'MISSING'));
description.add(new DiagnosticsProperty<Constraints>('constraints', constraints, ifNull: 'MISSING'));
description.add(new DiagnosticsProperty<dynamic>('creator', debugCreator, defaultValue: null, level: DiagnosticLevel.debug));
description.add(new DiagnosticsProperty<ParentData>('parentData', parentData, tooltip: _debugCanParentUseSize == true ? 'can use size' : null, missingIfNull: true));
description.add(new DiagnosticsProperty<Constraints>('constraints', constraints, missingIfNull: true));
// don't access it via the "layer" getter since that's only valid when we don't need paint
description.add(new DiagnosticsProperty<OffsetLayer>('layer', _layer, defaultValue: null));
description.add(new DiagnosticsProperty<SemanticsNode>('semantics node', _semantics, defaultValue: null));
......
......@@ -158,14 +158,14 @@ class SemanticsData extends Diagnosticable {
if ((actions & action.index) != 0)
actionSummary.add(describeEnum(action));
}
properties.add(new IterableProperty<String>('actions', actionSummary, hidden: actionSummary.isEmpty));
properties.add(new IterableProperty<String>('actions', actionSummary, ifEmpty: null));
final List<String> flagSummary = <String>[];
for (SemanticsFlags flag in SemanticsFlags.values.values) {
if ((flags & flag.index) != 0)
flagSummary.add(describeEnum(flag));
}
properties.add(new IterableProperty<String>('flags', flagSummary, hidden: flagSummary.isEmpty));
properties.add(new IterableProperty<String>('flags', flagSummary, ifEmpty: null));
properties.add(new StringProperty('label', label, defaultValue: ''));
properties.add(new EnumProperty<TextDirection>('textDirection', textDirection, defaultValue: null));
}
......@@ -758,7 +758,7 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
properties.add(new FlagProperty('inDirtyNodes', value: inDirtyNodes, ifTrue: 'dirty', ifFalse: 'STALE'));
hideOwner = inDirtyNodes;
}
properties.add(new DiagnosticsProperty<SemanticsOwner>('owner', owner, hidden: hideOwner));
properties.add(new DiagnosticsProperty<SemanticsOwner>('owner', owner, level: hideOwner ? DiagnosticLevel.hidden : DiagnosticLevel.info));
properties.add(new FlagProperty('shouldMergeAllDescendantsIntoThisNode', value: _shouldMergeAllDescendantsIntoThisNode, ifTrue: 'leaf merge'));
final Offset offset = transform != null ? MatrixUtils.getAsTranslation(transform) : null;
if (offset != null) {
......@@ -780,8 +780,8 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
if ((_actions & action.index) != 0)
actions.add(describeEnum(action));
}
properties.add(new IterableProperty<String>('actions', actions, hidden: actions.isEmpty));
properties.add(new IterableProperty<SemanticsTag>('tags', _tags, hidden: _tags.isEmpty));
properties.add(new IterableProperty<String>('actions', actions, ifEmpty: null));
properties.add(new IterableProperty<SemanticsTag>('tags', _tags, ifEmpty: null));
if (hasCheckedState)
properties.add(new FlagProperty('isChecked', value: isChecked, ifTrue: 'checked', ifFalse: 'unchecked'));
properties.add(new FlagProperty('isSelected', value: isSelected, ifTrue: 'selected'));
......@@ -797,10 +797,11 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
String toStringDeep({
String prefixLineOne: '',
String prefixOtherLines,
DiagnosticLevel minLevel: DiagnosticLevel.debug,
DebugSemanticsDumpOrder childOrder: DebugSemanticsDumpOrder.traversal,
}) {
assert(childOrder != null);
return toDiagnosticsNode(childOrder: childOrder).toStringDeep(prefixLineOne: prefixLineOne, prefixOtherLines: prefixOtherLines);
return toDiagnosticsNode(childOrder: childOrder).toStringDeep(prefixLineOne: prefixLineOne, prefixOtherLines: prefixOtherLines, minLevel: minLevel);
}
@override
......
......@@ -1026,7 +1026,7 @@ abstract class RenderSliver extends RenderObject {
assert(geometry.debugAssertIsValid(
informationCollector: (StringBuffer information) {
information.writeln('The RenderSliver that returned the offending geometry was:');
information.writeln(' ${toStringShallow('\n ')}');
information.writeln(' ${toStringShallow(joiner: '\n ')}');
},
));
assert(() {
......@@ -1034,7 +1034,7 @@ abstract class RenderSliver extends RenderObject {
throw new FlutterError(
'SliverGeometry has a paintOffset that exceeds the remainingPaintExtent from the constraints.\n'
'The render object whose geometry violates the constraints is the following:\n'
' ${toStringShallow('\n ')}\n' +
' ${toStringShallow(joiner: '\n ')}\n' +
_debugCompareFloats('remainingPaintExtent', constraints.remainingPaintExtent,
'paintExtent', geometry.paintExtent) +
'The paintExtent must cause the child sliver to paint within the viewport, and so '
......
......@@ -1281,7 +1281,7 @@ class RenderTable extends RenderBox {
void debugFillProperties(DiagnosticPropertiesBuilder description) {
super.debugFillProperties(description);
description.add(new DiagnosticsProperty<TableBorder>('border', border, defaultValue: null));
description.add(new DiagnosticsProperty<Map<int, TableColumnWidth>>('specified column widths', _columnWidths, hidden: _columnWidths.isEmpty));
description.add(new DiagnosticsProperty<Map<int, TableColumnWidth>>('specified column widths', _columnWidths, level: _columnWidths.isEmpty ? DiagnosticLevel.hidden : DiagnosticLevel.info));
description.add(new DiagnosticsProperty<TableColumnWidth>('default column width', defaultColumnWidth));
description.add(new MessageProperty('table size', '$columns\u00D7$rows'));
description.add(new IterableProperty<double>('column offsets', _columnLefts, ifNull: 'unknown'));
......
......@@ -158,7 +158,7 @@ class ImageStream extends Diagnosticable {
_listeners,
ifPresent: '${_listeners?.length} listener${_listeners?.length == 1 ? "" : "s" }',
ifNull: 'no listeners',
hidden: _completer != null,
level: _completer != null ? DiagnosticLevel.hidden : DiagnosticLevel.info,
));
_completer?.debugFillProperties(properties);
}
......
......@@ -1464,9 +1464,9 @@ class SizedBox extends SingleChildRenderObjectWidget {
@override
void debugFillProperties(DiagnosticPropertiesBuilder description) {
super.debugFillProperties(description);
final bool hidden = width == double.INFINITY && height == double.INFINITY;
description.add(new DoubleProperty('width', width, defaultValue: null, hidden: hidden));
description.add(new DoubleProperty('height', height, defaultValue: null, hidden: hidden));
final DiagnosticLevel level = (width == double.INFINITY && height == double.INFINITY) ? DiagnosticLevel.hidden : DiagnosticLevel.info;
description.add(new DoubleProperty('width', width, defaultValue: null, level: level));
description.add(new DoubleProperty('height', height, defaultValue: null, level: level));
}
}
......
......@@ -99,7 +99,7 @@ class DecoratedBox extends SingleChildRenderObjectWidget {
} else {
label = 'decoration';
}
description.add(new EnumProperty<DecorationPosition>('position', position, hidden: position != null));
description.add(new EnumProperty<DecorationPosition>('position', position, level: position != null ? DiagnosticLevel.hidden : DiagnosticLevel.info));
description.add(new DiagnosticsProperty<Decoration>(
label,
decoration,
......
......@@ -15,6 +15,7 @@ export 'dart:ui' show hashValues, hashList;
export 'package:flutter/foundation.dart' show FlutterError, debugPrint, debugPrintStack;
export 'package:flutter/foundation.dart' show VoidCallback, ValueChanged, ValueGetter, ValueSetter;
export 'package:flutter/foundation.dart' show DiagnosticLevel;
export 'package:flutter/rendering.dart' show RenderObject, RenderBox, debugDumpRenderTree, debugDumpLayerTree;
// Examples can assume:
......@@ -3131,7 +3132,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
'The size getter was called for the following element:\n'
' $this\n'
'The associated render sliver was:\n'
' ${renderObject.toStringShallow("\n ")}'
' ${renderObject.toStringShallow(joiner: "\n ")}'
);
}
if (renderObject is! RenderBox) {
......@@ -3144,7 +3145,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
'The size getter was called for the following element:\n'
' $this\n'
'The associated render object was:\n'
' ${renderObject.toStringShallow("\n ")}'
' ${renderObject.toStringShallow(joiner: "\n ")}'
);
}
final RenderBox box = renderObject;
......@@ -3159,7 +3160,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
'The size getter was called for the following element:\n'
' $this\n'
'The render object from which the size was to be obtained was:\n'
' ${box.toStringShallow("\n ")}'
' ${box.toStringShallow(joiner: "\n ")}'
);
}
if (box.debugNeedsLayout) {
......@@ -3173,7 +3174,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
'The size getter was called for the following element:\n'
' $this\n'
'The render object from which the size was to be obtained was:\n'
' ${box.toStringShallow("\n ")}\n'
' ${box.toStringShallow(joiner: "\n ")}\n'
'Consider using debugPrintMarkNeedsLayoutStacks to determine why the render '
'object in question is dirty, if you did not expect this.'
);
......@@ -3333,7 +3334,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
description.add(new ObjectFlagProperty<int>('depth', depth, ifNull: 'no depth'));
description.add(new ObjectFlagProperty<Widget>('widget', widget, ifNull: 'no widget'));
if (widget != null) {
description.add(new DiagnosticsProperty<Key>('key', widget?.key, showName: false, defaultValue: null, hidden: true));
description.add(new DiagnosticsProperty<Key>('key', widget?.key, showName: false, defaultValue: null, level: DiagnosticLevel.hidden));
widget.debugFillProperties(description);
}
description.add(new FlagProperty('dirty', value: dirty, ifTrue: 'dirty'));
......
......@@ -713,7 +713,7 @@ class RawGestureDetectorState extends State<RawGestureDetector> {
if (gestures.isEmpty)
gestures.add('<none>');
description.add(new IterableProperty<String>('gestures', gestures));
description.add(new IterableProperty<GestureRecognizer>('recognizers', _recognizers.values, hidden: true));
description.add(new IterableProperty<GestureRecognizer>('recognizers', _recognizers.values, level: DiagnosticLevel.fine));
}
description.add(new EnumProperty<HitTestBehavior>('behavior', widget.behavior, defaultValue: null));
}
......
......@@ -71,7 +71,7 @@ void main() {
);
expect(coloredBox, hasAGoodToStringDeep);
expect(coloredBox.toStringDeep(), equalsIgnoringHashCodes(
expect(coloredBox.toStringDeep(minLevel: DiagnosticLevel.info), equalsIgnoringHashCodes(
'RenderDecoratedBox#00000 NEEDS-LAYOUT NEEDS-PAINT DETACHED\n'
' parentData: MISSING\n'
' constraints: MISSING\n'
......@@ -94,7 +94,7 @@ void main() {
expect(coloredBox, hasAGoodToStringDeep);
expect(
coloredBox.toStringDeep(),
coloredBox.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'RenderDecoratedBox#00000 NEEDS-PAINT\n'
' parentData: offset=Offset(10.0, 10.0) (can use size)\n'
......
......@@ -22,7 +22,7 @@ void main() {
expect(editable.getMaxIntrinsicHeight(double.INFINITY), 10.0);
expect(
editable.toStringDeep(),
editable.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'RenderEditable#00000 NEEDS-LAYOUT NEEDS-PAINT DETACHED\n'
' │ parentData: MISSING\n'
......
......@@ -88,7 +88,7 @@ void main() {
expect(flex.direction, equals(Axis.horizontal));
expect(flex, hasAGoodToStringDeep);
expect(
flex.toStringDeep(),
flex.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'RenderFlex#00000 NEEDS-LAYOUT NEEDS-PAINT DETACHED\n'
' parentData: MISSING\n'
......
......@@ -67,7 +67,7 @@ void main() {
expect(image, hasAGoodToStringDeep);
expect(
image.toStringDeep(),
image.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'RenderImage#00000 relayoutBoundary=up2 NEEDS-PAINT\n'
' parentData: <none> (can use size)\n'
......
......@@ -30,7 +30,7 @@ void main() {
expect(parent, hasAGoodToStringDeep);
expect(
parent.toStringDeep(),
parent.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'RenderConstrainedOverflowBox#00000 NEEDS-PAINT\n'
' │ parentData: <none>\n'
......@@ -116,7 +116,7 @@ void main() {
expect(parent, hasAGoodToStringDeep);
expect(
parent.toStringDeep(),
parent.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'RenderConstrainedOverflowBox#00000 NEEDS-PAINT\n'
' │ parentData: <none>\n'
......@@ -152,7 +152,7 @@ void main() {
expect(parent, hasAGoodToStringDeep);
expect(
parent.toStringDeep(),
parent.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'RenderConstrainedOverflowBox#00000 NEEDS-PAINT\n'
' │ parentData: <none>\n'
......
......@@ -229,7 +229,7 @@ void main() {
);
expect(paragraph, hasAGoodToStringDeep);
expect(
paragraph.toStringDeep(),
paragraph.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'RenderParagraph#00000 NEEDS-LAYOUT NEEDS-PAINT DETACHED\n'
' │ parentData: MISSING\n'
......
......@@ -169,11 +169,17 @@ void main() {
});
test('debug properties', () {
final SemanticsNode minimalProperties = new SemanticsNode();
expect(
new SemanticsNode().toStringDeep(),
minimalProperties.toStringDeep(),
'SemanticsNode#16(Rect.fromLTRB(0.0, 0.0, 0.0, 0.0))\n',
);
expect(
minimalProperties.toStringDeep(minLevel: DiagnosticLevel.hidden),
'SemanticsNode#16(owner: null, shouldMergeAllDescendantsIntoThisNode: false, Rect.fromLTRB(0.0, 0.0, 0.0, 0.0), wasAffectedByClip: false, actions: [], tags: [], isSelected: false, label: "", textDirection: null)\n',
);
final SemanticsNode allProperties = new SemanticsNode()
..rect = new Rect.fromLTWH(50.0, 10.0, 20.0, 30.0)
..mergeAllDescendantsIntoThisNode = true
......
......@@ -16,7 +16,7 @@ void main() {
);
expect(root, hasAGoodToStringDeep);
expect(
root.toStringDeep(),
root.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'RenderViewport#00000 NEEDS-LAYOUT NEEDS-PAINT DETACHED\n'
' parentData: MISSING\n'
......@@ -32,7 +32,7 @@ void main() {
root.offset = new ViewportOffset.fixed(900.0);
expect(root, hasAGoodToStringDeep);
expect(
root.toStringDeep(),
root.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'RenderViewport#00000 NEEDS-LAYOUT NEEDS-PAINT\n'
' parentData: <none>\n'
......@@ -69,7 +69,7 @@ void main() {
expect(root, hasAGoodToStringDeep);
expect(
root.toStringDeep(),
root.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'RenderViewport#00000 NEEDS-PAINT\n'
' │ parentData: <none>\n'
......
......@@ -23,7 +23,7 @@ void main() {
expect(table, hasAGoodToStringDeep);
expect(
table.toStringDeep(),
table.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'RenderTable#00000 NEEDS-PAINT\n'
' │ parentData: <none>\n'
......@@ -74,7 +74,7 @@ void main() {
expect(table, hasAGoodToStringDeep);
expect(
table.toStringDeep(),
table.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'RenderTable#00000 relayoutBoundary=up1 NEEDS-PAINT\n'
' │ parentData: offset=Offset(335.0, 185.0) (can use size)\n'
......
......@@ -10,7 +10,7 @@ void main() {
final RenderWrap renderWrap = new RenderWrap();
expect(renderWrap, hasAGoodToStringDeep);
expect(
renderWrap.toStringDeep(),
renderWrap.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'RenderWrap#00000 NEEDS-LAYOUT NEEDS-PAINT DETACHED\n'
' parentData: MISSING\n'
......
......@@ -68,11 +68,9 @@ void main() {
expect(box, hasAGoodToStringDeep);
expect(
box.toStringDeep(),
box.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'RenderDecoratedBox#00000\n'
' │ creator: DecoratedBox ← Container ←\n'
' │ AnimatedContainer-[GlobalKey#00000] ← [root]\n'
' │ parentData: <none>\n'
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ size: Size(800.0, 600.0)\n'
......@@ -83,8 +81,6 @@ void main() {
' │ android)\n'
' │\n'
' └─child: RenderLimitedBox#00000\n'
' │ creator: LimitedBox ← DecoratedBox ← Container ←\n'
' │ AnimatedContainer-[GlobalKey#00000] ← [root]\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ size: Size(800.0, 600.0)\n'
......@@ -92,8 +88,6 @@ void main() {
' │ maxHeight: 0.0\n'
' │\n'
' └─child: RenderConstrainedBox#00000\n'
' creator: ConstrainedBox ← LimitedBox ← DecoratedBox ← Container ←\n'
' AnimatedContainer-[GlobalKey#00000] ← [root]\n'
' parentData: <none> (can use size)\n'
' constraints: BoxConstraints(w=800.0, h=600.0)\n'
' size: Size(800.0, 600.0)\n'
......
......@@ -81,11 +81,9 @@ void main() {
expect(box, hasAGoodToStringDeep);
expect(
box.toStringDeep(),
box.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'RenderLimitedBox#00000\n'
' │ creator: LimitedBox ← Container-[GlobalKey#00000] ← Positioned ←\n'
' │ AnimatedPositioned ← Stack ← [root]\n'
' │ parentData: top=31.0; left=37.0; width=59.0; height=71.0;\n'
' │ offset=Offset(37.0, 31.0) (can use size)\n'
' │ constraints: BoxConstraints(w=59.0, h=71.0)\n'
......@@ -94,9 +92,6 @@ void main() {
' │ maxHeight: 0.0\n'
' │\n'
' └─child: RenderConstrainedBox#00000\n'
' creator: ConstrainedBox ← LimitedBox ←\n'
' Container-[GlobalKey#00000] ← Positioned ← AnimatedPositioned ←\n'
' Stack ← [root]\n'
' parentData: <none> (can use size)\n'
' constraints: BoxConstraints(w=59.0, h=71.0)\n'
' size: Size(59.0, 71.0)\n'
......
......@@ -170,7 +170,7 @@ void main() {
expect(parentFocusScope, hasAGoodToStringDeep);
expect(
parentFocusScope.toStringDeep(),
parentFocusScope.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'FocusScopeNode#00000\n'
' focus: FocusNode#00000(FOCUSED)\n'
......@@ -179,7 +179,7 @@ void main() {
expect(WidgetsBinding.instance.focusManager.rootScope, hasAGoodToStringDeep);
expect(
WidgetsBinding.instance.focusManager.rootScope.toStringDeep(),
WidgetsBinding.instance.focusManager.rootScope.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'FocusScopeNode#00000\n'
' └─child 1: FocusScopeNode#00000\n'
......
......@@ -39,7 +39,7 @@ void main() {
maxHeight: 4.0
).debugFillProperties(builder);
final List<String> description = builder.properties
.where((DiagnosticsNode n) => !n.hidden)
.where((DiagnosticsNode n) => !n.isFiltered(DiagnosticLevel.info))
.map((DiagnosticsNode n) => n.toString()).toList();
expect(description, <String>[
'alignment: FractionalOffset.center',
......
......@@ -34,18 +34,14 @@ void main() {
expect(theater, hasAGoodToStringDeep);
expect(
theater.toStringDeep(),
theater.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'_RenderTheatre#00000\n'
' │ creator: _Theatre ← Overlay-[GlobalKey#00000] ← Directionality ←\n'
' │ [root]\n'
'_RenderTheatre#f5cf2\n'
' │ parentData: <none>\n'
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ size: Size(800.0, 600.0)\n'
' │\n'
' ├─onstage: RenderStack#00000\n'
' ╎ │ creator: Stack ← _Theatre ← Overlay-[GlobalKey#00000] ←\n'
' ╎ │ Directionality ← [root]\n'
' ├─onstage: RenderStack#39819\n'
' ╎ │ parentData: not positioned; offset=Offset(0.0, 0.0) (can use\n'
' ╎ │ size)\n'
' ╎ │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
......@@ -55,11 +51,7 @@ void main() {
' ╎ │ fit: expand\n'
' ╎ │ overflow: clip\n'
' ╎ │\n'
' ╎ └─child 1: RenderLimitedBox#00000\n'
' ╎ │ creator: LimitedBox ← Container ←\n'
' ╎ │ _OverlayEntry-[LabeledGlobalKey<_OverlayEntryState>#00000] ←\n'
' ╎ │ Stack ← _Theatre ← Overlay-[GlobalKey#00000] ← Directionality ←\n'
' ╎ │ [root]\n'
' ╎ └─child 1: RenderLimitedBox#d1448\n'
' ╎ │ parentData: not positioned; offset=Offset(0.0, 0.0) (can use\n'
' ╎ │ size)\n'
' ╎ │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
......@@ -67,11 +59,7 @@ void main() {
' ╎ │ maxWidth: 0.0\n'
' ╎ │ maxHeight: 0.0\n'
' ╎ │\n'
' ╎ └─child: RenderConstrainedBox#00000\n'
' ╎ creator: ConstrainedBox ← LimitedBox ← Container ←\n'
' ╎ _OverlayEntry-[LabeledGlobalKey<_OverlayEntryState>#00000] ←\n'
' ╎ Stack ← _Theatre ← Overlay-[GlobalKey#00000] ← Directionality ←\n'
' ╎ [root]\n'
' ╎ └─child: RenderConstrainedBox#e8b87\n'
' ╎ parentData: <none> (can use size)\n'
' ╎ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' ╎ size: Size(800.0, 600.0)\n'
......@@ -113,18 +101,14 @@ void main() {
expect(theater, hasAGoodToStringDeep);
expect(
theater.toStringDeep(),
theater.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'_RenderTheatre#00000\n'
' │ creator: _Theatre ← Overlay-[GlobalKey#00000] ← Directionality ←\n'
' │ [root]\n'
'_RenderTheatre#b22a8\n'
' │ parentData: <none>\n'
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ size: Size(800.0, 600.0)\n'
' │\n'
' ├─onstage: RenderStack#00000\n'
' ╎ │ creator: Stack ← _Theatre ← Overlay-[GlobalKey#00000] ←\n'
' ╎ │ Directionality ← [root]\n'
' ├─onstage: RenderStack#eab87\n'
' ╎ │ parentData: not positioned; offset=Offset(0.0, 0.0) (can use\n'
' ╎ │ size)\n'
' ╎ │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
......@@ -134,11 +118,7 @@ void main() {
' ╎ │ fit: expand\n'
' ╎ │ overflow: clip\n'
' ╎ │\n'
' ╎ └─child 1: RenderLimitedBox#00000\n'
' ╎ │ creator: LimitedBox ← Container ←\n'
' ╎ │ _OverlayEntry-[LabeledGlobalKey<_OverlayEntryState>#00000] ←\n'
' ╎ │ Stack ← _Theatre ← Overlay-[GlobalKey#00000] ← Directionality ←\n'
' ╎ │ [root]\n'
' ╎ └─child 1: RenderLimitedBox#ca15b\n'
' ╎ │ parentData: not positioned; offset=Offset(0.0, 0.0) (can use\n'
' ╎ │ size)\n'
' ╎ │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
......@@ -146,53 +126,33 @@ void main() {
' ╎ │ maxWidth: 0.0\n'
' ╎ │ maxHeight: 0.0\n'
' ╎ │\n'
' ╎ └─child: RenderConstrainedBox#00000\n'
' ╎ creator: ConstrainedBox ← LimitedBox ← Container ←\n'
' ╎ _OverlayEntry-[LabeledGlobalKey<_OverlayEntryState>#00000] ←\n'
' ╎ Stack ← _Theatre ← Overlay-[GlobalKey#00000] ← Directionality ←\n'
' ╎ [root]\n'
' ╎ └─child: RenderConstrainedBox#dffe5\n'
' ╎ parentData: <none> (can use size)\n'
' ╎ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' ╎ size: Size(800.0, 600.0)\n'
' ╎ additionalConstraints: BoxConstraints(biggest)\n'
' ╎\n'
' ╎╌offstage 1: RenderLimitedBox#00000 NEEDS-LAYOUT NEEDS-PAINT\n'
' ╎ │ creator: LimitedBox ← Container ←\n'
' ╎ │ _OverlayEntry-[LabeledGlobalKey<_OverlayEntryState>#00000] ←\n'
' ╎ │ TickerMode ← _Theatre ← Overlay-[GlobalKey#00000] ←\n'
' ╎ │ Directionality ← [root]\n'
' ╎╌offstage 1: RenderLimitedBox#b6f09 NEEDS-LAYOUT NEEDS-PAINT\n'
' ╎ │ parentData: not positioned; offset=Offset(0.0, 0.0)\n'
' ╎ │ constraints: MISSING\n'
' ╎ │ size: MISSING\n'
' ╎ │ maxWidth: 0.0\n'
' ╎ │ maxHeight: 0.0\n'
' ╎ │\n'
' ╎ └─child: RenderConstrainedBox#00000 NEEDS-LAYOUT NEEDS-PAINT\n'
' ╎ creator: ConstrainedBox ← LimitedBox ← Container ←\n'
' ╎ _OverlayEntry-[LabeledGlobalKey<_OverlayEntryState>#00000] ←\n'
' ╎ TickerMode ← _Theatre ← Overlay-[GlobalKey#00000] ←\n'
' ╎ Directionality ← [root]\n'
' ╎ └─child: RenderConstrainedBox#5a057 NEEDS-LAYOUT NEEDS-PAINT\n'
' ╎ parentData: <none>\n'
' ╎ constraints: MISSING\n'
' ╎ size: MISSING\n'
' ╎ additionalConstraints: BoxConstraints(biggest)\n'
' ╎\n'
' └╌offstage 2: RenderLimitedBox#00000 NEEDS-LAYOUT NEEDS-PAINT\n'
' │ creator: LimitedBox ← Container ←\n'
' │ _OverlayEntry-[LabeledGlobalKey<_OverlayEntryState>#00000] ←\n'
' │ TickerMode ← _Theatre ← Overlay-[GlobalKey#00000] ←\n'
' │ Directionality ← [root]\n'
' └╌offstage 2: RenderLimitedBox#f689e NEEDS-LAYOUT NEEDS-PAINT\n'
' │ parentData: not positioned; offset=Offset(0.0, 0.0)\n'
' │ constraints: MISSING\n'
' │ size: MISSING\n'
' │ maxWidth: 0.0\n'
' │ maxHeight: 0.0\n'
' │\n'
' └─child: RenderConstrainedBox#00000 NEEDS-LAYOUT NEEDS-PAINT\n'
' creator: ConstrainedBox ← LimitedBox ← Container ←\n'
' _OverlayEntry-[LabeledGlobalKey<_OverlayEntryState>#00000] ←\n'
' TickerMode ← _Theatre ← Overlay-[GlobalKey#00000] ←\n'
' Directionality ← [root]\n'
' └─child: RenderConstrainedBox#c15f0 NEEDS-LAYOUT NEEDS-PAINT\n'
' parentData: <none>\n'
' constraints: MISSING\n'
' size: MISSING\n'
......
......@@ -62,16 +62,9 @@ void main() {
final RenderObject viewport = tester.renderObject<RenderObject>(find.byType(SliverFillViewport).first);
expect(viewport, hasAGoodToStringDeep);
expect(
viewport.toStringDeep(),
viewport.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'RenderSliverFillViewport#00000 relayoutBoundary=up1\n'
' │ creator: SliverFillViewport ← Viewport ← _ScrollableScope ←\n'
' │ IgnorePointer-[GlobalKey#00000] ← Listener ← _GestureSemantics\n'
' │ ←\n'
' │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ ← RepaintBoundary ← CustomPaint ← RepaintBoundary ←\n'
' │ NotificationListener<ScrollNotification> ←\n'
' │ GlowingOverscrollIndicator ← ⋯\n'
' │ parentData: paintOffset=Offset(0.0, 0.0) (can use size)\n'
' │ constraints: SliverConstraints(AxisDirection.down,\n'
' │ GrowthDirection.forward, ScrollDirection.idle, scrollOffset:\n'
......@@ -83,12 +76,6 @@ void main() {
' │ currently live children: 0 to 0\n'
' │\n'
' └─child with index 0: RenderRepaintBoundary#00000\n'
' │ creator: RepaintBoundary-[<0>] ← SliverFillViewport ← Viewport ←\n'
' │ _ScrollableScope ← IgnorePointer-[GlobalKey#00000] ← Listener ←\n'
' │ _GestureSemantics ←\n'
' │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ ← RepaintBoundary ← CustomPaint ← RepaintBoundary ←\n'
' │ NotificationListener<ScrollNotification> ← ⋯\n'
' │ parentData: index=0; layoutOffset=0.0\n'
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ layer: OffsetLayer#00000\n'
......@@ -98,12 +85,6 @@ void main() {
' │ repaints)\n'
' │\n'
' └─child: RenderParagraph#00000\n'
' │ creator: RichText ← Text ← Container ← RepaintBoundary-[<0>] ←\n'
' │ SliverFillViewport ← Viewport ← _ScrollableScope ←\n'
' │ IgnorePointer-[GlobalKey#00000] ← Listener ← _GestureSemantics\n'
' │ ←\n'
' │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ ← RepaintBoundary ← ⋯\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ size: Size(800.0, 600.0)\n'
......
......@@ -82,16 +82,9 @@ void main() {
delegateThatCanThrow.shouldThrow = true;
expect(renderObject, hasAGoodToStringDeep);
expect(
renderObject.toStringDeep(),
renderObject.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'_RenderSliverPinnedPersistentHeaderForWidgets#00000 relayoutBoundary=up1\n'
' │ creator: _SliverPinnedPersistentHeader ←\n'
' │ SliverPersistentHeader-[GlobalKey#00000] ← Viewport ←\n'
' │ _ScrollableScope ← IgnorePointer-[GlobalKey#00000] ← Listener ←\n'
' │ _GestureSemantics ←\n'
' │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ ← RepaintBoundary ← CustomPaint ← RepaintBoundary ←\n'
' │ NotificationListener<ScrollNotification> ← ⋯\n'
' │ parentData: paintOffset=Offset(0.0, 0.0) (can use size)\n'
' │ constraints: SliverConstraints(AxisDirection.down,\n'
' │ GrowthDirection.forward, ScrollDirection.idle, scrollOffset:\n'
......@@ -104,13 +97,6 @@ void main() {
' │ child position: 0.0\n'
' │\n'
' └─child: RenderConstrainedBox#00000 relayoutBoundary=up2\n'
' │ creator: ConstrainedBox ← Container ←\n'
' │ _SliverPinnedPersistentHeader ←\n'
' │ SliverPersistentHeader-[GlobalKey#00000] ← Viewport ←\n'
' │ _ScrollableScope ← IgnorePointer-[GlobalKey#00000] ← Listener ←\n'
' │ _GestureSemantics ←\n'
' │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ ← RepaintBoundary ← CustomPaint ← ⋯\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=800.0, 0.0<=h<=200.0)\n'
' │ size: Size(800.0, 200.0)\n'
......@@ -118,13 +104,6 @@ void main() {
' │ 100.0<=h<=200.0)\n'
' │\n'
' └─child: RenderLimitedBox#00000 relayoutBoundary=up3\n'
' │ creator: LimitedBox ← ConstrainedBox ← Container ←\n'
' │ _SliverPinnedPersistentHeader ←\n'
' │ SliverPersistentHeader-[GlobalKey#00000] ← Viewport ←\n'
' │ _ScrollableScope ← IgnorePointer-[GlobalKey#00000] ← Listener ←\n'
' │ _GestureSemantics ←\n'
' │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ ← RepaintBoundary ← ⋯\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=800.0, 100.0<=h<=200.0)\n'
' │ size: Size(800.0, 200.0)\n'
......@@ -132,13 +111,6 @@ void main() {
' │ maxHeight: 0.0\n'
' │\n'
' └─child: RenderConstrainedBox#00000 relayoutBoundary=up4\n'
' creator: ConstrainedBox ← LimitedBox ← ConstrainedBox ← Container\n'
' ← _SliverPinnedPersistentHeader ←\n'
' SliverPersistentHeader-[GlobalKey#00000] ← Viewport ←\n'
' _ScrollableScope ← IgnorePointer-[GlobalKey#00000] ← Listener ←\n'
' _GestureSemantics ←\n'
' RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' ← ⋯\n'
' parentData: <none> (can use size)\n'
' constraints: BoxConstraints(w=800.0, 100.0<=h<=200.0)\n'
' size: Size(800.0, 200.0)\n'
......
......@@ -541,7 +541,7 @@ void main() {
final RenderObjectElement element = key0.currentContext;
expect(element, hasAGoodToStringDeep);
expect(
element.toStringDeep(),
element.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'Table-[GlobalKey#00000](renderObject: RenderTable#00000)\n'
'├Text("A")\n'
......
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