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';
......
......@@ -6,6 +6,63 @@ import 'package:meta/meta.dart';
import 'print.dart';
/// The various priority levels used to filter which diagnostics are shown and
/// omitted.
///
/// Trees of Flutter diagnostics can be very large so filtering the diagnostics
/// shown matters. Typically filtering to only show diagnostics with at least
/// level [debug] is appropriate.
enum DiagnosticLevel {
/// Diagnostics that should not be shown.
///
/// If a user chooses to display [hidden] diagnostics, they should not expect
/// the diagnostics to be formatted consistently with other diagnostics and
/// they should expect them to sometimes be be misleading. For example,
/// [FlagProperty] and [ObjectFlagProperty] have uglier formatting when the
/// property `value` does does not match a value with a custom flag
/// description. An example of a misleading diagnostic is a diagnostic for
/// a property that has no effect because some other property of the object is
/// set in a way that causes the hidden property to have no effect.
hidden,
/// A diagnostic that is likely to be low value but where the diagnostic
/// display is just as high quality as a diagnostic with a higher level.
///
/// Use this level for diagnostic properties that match their default value
/// and other cases where showing a diagnostic would not add much value such
/// as an [IterableProperty] where the value is empty.
fine,
/// Diagnostics that should only be shown when performing fine grained
/// debugging of an object.
///
/// Unlike a [fine] diagnostic, these diagnostics provide important
/// information about the object that is likely to be needed to debug. Used by
/// properties that are important but where the property value is too verbose
/// (e.g. 300+ characters long) to show with a higher diagnostic level.
debug,
/// Interesting diagnostics that should be typically shown.
info,
/// Very important diagnostics that indicate problematic property values.
///
/// For example, use if you would write the property description
/// message in ALL CAPS.
warning,
/// Diagnostics that indicate errors or unexpected conditions.
///
/// For example, use for property values where computing the value throws an
/// exception.
error,
/// Special level indicating that no diagnostics should be shown.
///
/// Do not specify this level for diagnostics. This level is only used to
/// filter which diagnostics are shown.
off,
}
/// Styles for displaying a node in a [DiagnosticsNode] tree.
///
/// See also:
......@@ -577,7 +634,8 @@ const _NoDefaultValue kNoDefaultValue = const _NoDefaultValue();
abstract class DiagnosticsNode {
/// Initializes the object.
///
/// The [style], [showName] and [showSeparator] arguments must not be null.
/// The [style], [showName], and [showSeparator] arguments must not
/// be null.
DiagnosticsNode({
@required this.name,
this.style,
......@@ -594,7 +652,7 @@ abstract class DiagnosticsNode {
/// Diagnostics containing just a string `message` and not a concrete name or
/// value.
///
/// The [style] argument must not be null.
/// The [style] and [level] arguments must not be null.
///
/// See also:
///
......@@ -603,14 +661,17 @@ abstract class DiagnosticsNode {
factory DiagnosticsNode.message(
String message, {
DiagnosticsTreeStyle style: DiagnosticsTreeStyle.singleLine,
DiagnosticLevel level: DiagnosticLevel.info,
}) {
assert(style != null);
assert(level != null);
return new DiagnosticsProperty<Null>(
'',
null,
description: message,
style: style,
showName: false,
level: level,
);
}
......@@ -634,9 +695,23 @@ abstract class DiagnosticsNode {
/// `:` is typically used as a separator when displaying as text.
final bool showSeparator;
/// Whether the diagnostics should be hidden when showing the default
/// view of a tree.
bool get hidden;
/// Whether the diagnostic should be filtered due to its [level] being lower
/// than `minLevel`.
///
/// If `minLevel` is [DiagnosticLevel.hidden] no diagnostics will be filtered.
/// If `minLevel` is [DiagnosticsLevel.off] all diagnostics will be filtered.
bool isFiltered(DiagnosticLevel minLevel) => level.index < minLevel.index;
/// Priority level of the diagnostic used to control which diagnostics should
/// be shown and filtered.
///
/// Typically this only makes sense to set to a different value than
/// [DiagnosticLevel.info] for diagnostics representing properties. Some
/// subclasses have a `level` argument to their constructor which influences
/// the value returned here but other factors also influence it. For example,
/// whether an exception is thrown computing a property value
/// [DiagnosticLevel.error] is returned.
DiagnosticLevel get level => DiagnosticLevel.info;
/// Whether the name of the property should be shown when showing the default
/// view of the tree.
......@@ -675,11 +750,18 @@ abstract class DiagnosticsNode {
/// `parentConfiguration` specifies how the parent is rendered as text art.
/// For example, if the parent places all properties on one line, the
/// [toString] for each property should avoid line breaks if possible.
///
/// `minLevel` specifies the minimum [DiagnosticLevel] for properties included
/// in the output.
@override
String toString({ TextTreeConfiguration parentConfiguration }) {
String toString({
TextTreeConfiguration parentConfiguration,
DiagnosticLevel minLevel: DiagnosticLevel.info,
}) {
assert(style != null);
assert(minLevel != null);
if (style == DiagnosticsTreeStyle.singleLine)
return toStringDeep(parentConfiguration: parentConfiguration);
return toStringDeep(parentConfiguration: parentConfiguration, minLevel: minLevel);
final String description = toDescription(parentConfiguration: parentConfiguration);
......@@ -728,8 +810,11 @@ abstract class DiagnosticsNode {
/// Returns a string representation of this node and its descendants.
///
/// The [toStringDeep] method takes arguments, but those are intended for
/// internal use when recursing to the descendants, and so can be ignored.
/// `minLevel` specifies the minimum [DiagnosticLevel] for properties included
/// in the output.
///
/// The [toStringDeep] method takes other arguments, but those are intended
/// for internal use when recursing to the descendants, and so can be ignored.
///
/// See also:
///
......@@ -740,7 +825,9 @@ abstract class DiagnosticsNode {
String prefixLineOne: '',
String prefixOtherLines,
TextTreeConfiguration parentConfiguration,
DiagnosticLevel minLevel: DiagnosticLevel.debug,
}) {
assert(minLevel != null);
prefixOtherLines ??= prefixLineOne;
final List<DiagnosticsNode> children = getChildren();
......@@ -770,7 +857,8 @@ abstract class DiagnosticsNode {
}
final List<DiagnosticsNode> properties =
getProperties().where((DiagnosticsNode n) => !n.hidden).toList();
getProperties().where((DiagnosticsNode n) => !n.isFiltered(minLevel)).toList();
if (properties.isNotEmpty || children.isNotEmpty || emptyBodyDescription != null)
builder.write(config.afterDescriptionIfBody);
......@@ -800,14 +888,15 @@ abstract class DiagnosticsNode {
if (property.style != DiagnosticsTreeStyle.singleLine) {
final TextTreeConfiguration propertyStyle = property.textTreeConfiguration;
builder.writeRaw(property.toStringDeep(
prefixLineOne: '${builder.prefixOtherLines}${propertyStyle.prefixLineOne}',
prefixOtherLines: '${builder.prefixOtherLines}${propertyStyle.linkCharacter}${propertyStyle.prefixOtherLines}',
parentConfiguration: config,
prefixLineOne: '${builder.prefixOtherLines}${propertyStyle.prefixLineOne}',
prefixOtherLines: '${builder.prefixOtherLines}${propertyStyle.linkCharacter}${propertyStyle.prefixOtherLines}',
parentConfiguration: config,
minLevel: minLevel,
));
continue;
}
assert(property.style == DiagnosticsTreeStyle.singleLine);
final String message = property.toString(parentConfiguration: config);
final String message = property.toString(parentConfiguration: config, minLevel: minLevel);
if (!config.lineBreakProperties || message.length < kWrapWidth) {
builder.write(message);
} else {
......@@ -857,6 +946,7 @@ abstract class DiagnosticsNode {
prefixLineOne: lastChildPrefixLineOne,
prefixOtherLines: '$prefixChildren${childConfig.childLinkSpace}${childConfig.prefixOtherLines}',
parentConfiguration: config,
minLevel: minLevel,
));
if (childConfig.footer.isNotEmpty)
builder.writeRaw('$prefixChildren${childConfig.childLinkSpace}${childConfig.footer}');
......@@ -864,7 +954,12 @@ abstract class DiagnosticsNode {
final TextTreeConfiguration nextChildStyle = _childTextConfiguration(children[i + 1], config);
final String childPrefixLineOne = '$prefixChildren${childConfig.prefixLineOne}';
final String childPrefixOtherLines ='$prefixChildren${nextChildStyle.linkCharacter}${childConfig.prefixOtherLines}';
builder.writeRawLine(child.toStringDeep(prefixLineOne: childPrefixLineOne, prefixOtherLines: childPrefixOtherLines));
builder.writeRawLine(child.toStringDeep(
prefixLineOne: childPrefixLineOne,
prefixOtherLines: childPrefixOtherLines,
parentConfiguration: config,
minLevel: minLevel,
));
if (childConfig.footer.isNotEmpty)
builder.writeRaw('$prefixChildren${nextChildStyle.linkCharacter}${childConfig.footer}');
}
......@@ -908,11 +1003,13 @@ class MessageProperty extends DiagnosticsProperty<Null> {
/// Messages have no concrete [value] (so [value] will return null). The
/// message is stored as the description.
///
/// The [name] and `message` arguments must not be null.
MessageProperty(String name, String message)
: assert(name != null),
assert(message != null),
super(name, null, description: message);
/// The [name], `message`, and [level] arguments must not be null.
MessageProperty(String name, String message, {
DiagnosticLevel level : DiagnosticLevel.info,
}) : assert(name != null),
assert(message != null),
assert(level != null),
super(name, null, description: message, level: level);
}
/// Property which encloses its string [value] in quotes.
......@@ -924,25 +1021,25 @@ class MessageProperty extends DiagnosticsProperty<Null> {
class StringProperty extends DiagnosticsProperty<String> {
/// Create a diagnostics property for strings.
///
/// The [showName], [hidden], and [quoted] arguments must not be null.
/// The [showName], [quoted], and [level] arguments must not be null.
StringProperty(String name, String value, {
String description,
bool showName: true,
Object defaultValue: kNoDefaultValue,
bool hidden: false,
this.quoted: true,
String ifEmpty,
DiagnosticLevel level : DiagnosticLevel. info,
}) : assert(showName != null),
assert(hidden != null),
assert(quoted != null),
assert(level != null),
super(
name,
value,
description: description,
defaultValue: defaultValue,
showName: showName,
hidden: hidden,
ifEmpty: ifEmpty,
level: level,
);
/// Whether the description is enclosed in double quotes.
......@@ -974,38 +1071,38 @@ class StringProperty extends DiagnosticsProperty<String> {
abstract class _NumProperty<T extends num> extends DiagnosticsProperty<T> {
_NumProperty(String name,
T value, {
bool hidden: false,
String ifNull,
this.unit,
bool showName: true,
Object defaultValue: kNoDefaultValue,
String tooltip,
DiagnosticLevel level: DiagnosticLevel.info,
}) : super(
name,
value,
hidden: hidden,
ifNull: ifNull,
showName: showName,
defaultValue: defaultValue,
tooltip: tooltip,
level: level,
);
_NumProperty.lazy(String name,
ComputePropertyValueCallback<T> computeValue, {
bool hidden: false,
String ifNull,
this.unit,
bool showName: true,
Object defaultValue: kNoDefaultValue,
String tooltip,
DiagnosticLevel level: DiagnosticLevel.info,
}) : super.lazy(
name,
computeValue,
hidden: hidden,
ifNull: ifNull,
showName: showName,
defaultValue: defaultValue,
tooltip: tooltip,
level: level,
);
......@@ -1032,44 +1129,54 @@ abstract class _NumProperty<T extends num> extends DiagnosticsProperty<T> {
/// Numeric formatting is optimized for debug message readability.
class DoubleProperty extends _NumProperty<double> {
/// If specified, [unit] describes the unit for the [value] (e.g. px).
///
/// The [showName] and [level] arguments must not be null.
DoubleProperty(String name, double value, {
bool hidden: false,
String ifNull,
String unit,
String tooltip,
Object defaultValue: kNoDefaultValue,
bool showName : true,
}) : super(
DiagnosticLevel level: DiagnosticLevel.info,
}) : assert(showName != null),
assert(level != null),
super(
name,
value,
hidden: hidden,
ifNull: ifNull,
unit: unit,
tooltip: tooltip,
defaultValue: defaultValue,
showName: showName,
level: level,
);
/// Property with a [value] that is computed only when needed.
///
/// Use if computing the property [value] may throw an exception or is
/// expensive.
///
/// The [showName] and [level] arguments must not be null.
DoubleProperty.lazy(
String name,
ComputePropertyValueCallback<double> computeValue, {
bool hidden: false,
String ifNull,
bool showName: true,
String unit,
String tooltip,
Object defaultValue: kNoDefaultValue,
}) : super.lazy(
DiagnosticLevel level: DiagnosticLevel.info,
}) : assert(showName != null),
assert(level != null),
super.lazy(
name,
computeValue,
hidden: hidden,
showName: showName,
ifNull: ifNull,
unit: unit,
tooltip: tooltip,
defaultValue: defaultValue,
level: level,
);
@override
......@@ -1082,15 +1189,15 @@ class DoubleProperty extends _NumProperty<double> {
class IntProperty extends _NumProperty<int> {
/// Create a diagnostics property for integers.
///
/// The [showName] and [hidden] arguments must not be null.
/// The [showName] and [level] arguments must not be null.
IntProperty(String name, int value, {
String ifNull,
bool showName: true,
String unit,
Object defaultValue: kNoDefaultValue,
bool hidden: false,
DiagnosticLevel level: DiagnosticLevel.info,
}) : assert(showName != null),
assert(hidden != null),
assert(level != null),
super(
name,
value,
......@@ -1098,7 +1205,7 @@ class IntProperty extends _NumProperty<int> {
showName: showName,
unit: unit,
defaultValue: defaultValue,
hidden: hidden,
level: level,
);
@override
......@@ -1115,15 +1222,15 @@ class PercentProperty extends DoubleProperty {
/// objects, as the fact that the property is shown as a percentage tends to
/// be sufficient to disambiguate its meaning.
///
/// The [showName] and [hidden] arguments must not be null.
/// The [showName] and [level] arguments must not be null.
PercentProperty(String name, double fraction, {
String ifNull,
bool showName: true,
String tooltip,
String unit,
bool hidden: false,
DiagnosticLevel level : DiagnosticLevel.info,
}) : assert(showName != null),
assert(hidden != null),
assert(level != null),
super(
name,
fraction,
......@@ -1131,7 +1238,7 @@ class PercentProperty extends DoubleProperty {
showName: showName,
tooltip: tooltip,
unit: unit,
hidden: hidden,
level: level,
);
@override
......@@ -1190,53 +1297,74 @@ class FlagProperty extends DiagnosticsProperty<bool> {
///
/// [showName] defaults to false as typically [ifTrue] and [ifFalse] should
/// be descriptions that make the property name redundant.
///
/// The [showName] and [level] arguments must not be null.
FlagProperty(String name, {
@required bool value,
this.ifTrue,
this.ifFalse,
bool showName: false,
bool hidden: false,
Object defaultValue,
}) : super(
DiagnosticLevel level: DiagnosticLevel.info,
}) : assert(showName != null),
assert(level != null),
super(
name,
value,
showName: showName,
hidden: hidden,
defaultValue: defaultValue,
level: level,
) {
assert(ifTrue != null || ifFalse != null);
}
/// Description to use if the property [value] is true.
///
/// If not specified and [value] equals true, the description is set to the
/// empty string and the property is [hidden].
/// If not specified and [value] equals true the property's priority [level]
/// will be [DiagnosticLevel.hidden].
final String ifTrue;
/// Description to use if the property value is false.
///
/// If not specified and [value] equals false, the description is set to the
/// empty string and the property is [hidden].
/// If not specified and [value] equals false, the property's priority [level]
/// will be [DiagnosticLevel.hidden].
final String ifFalse;
@override
String valueToString({ TextTreeConfiguration parentConfiguration }) {
if (value == true)
return ifTrue ?? '';
if (value == false)
return ifFalse ?? '';
return '';
if (value == true) {
if (ifTrue != null)
return ifTrue;
} else if (value == false) {
if (ifFalse != null)
return ifFalse;
}
return super.valueToString(parentConfiguration: parentConfiguration);
}
@override
bool get hidden {
if (_hidden || value == defaultValue)
bool get showName {
if (value == null || (value == true && ifTrue == null) || (value == false && ifFalse == null)) {
// We are missing a description for the flag value so we need to show the
// flag name. The property will have DiagnosticLevel.hidden for this case
// so users will not see this the property in this case unless they are
// displaying hidden properties.
return true;
if (value == true)
return ifTrue == null;
if (value == false)
return ifFalse == null;
return true;
}
return super.showName;
}
@override
DiagnosticLevel get level {
if (value == true) {
if (ifTrue == null)
return DiagnosticLevel.hidden;
}
if (value == false) {
if (ifFalse == null)
return DiagnosticLevel.hidden;
}
return super.level;
}
}
......@@ -1249,22 +1377,23 @@ class FlagProperty extends DiagnosticsProperty<bool> {
class IterableProperty<T> extends DiagnosticsProperty<Iterable<T>> {
/// Create a diagnostics property for iterables (e.g. lists).
///
/// The [ifEmpty] argument must not be null, as otherwise an iterable
/// value with 0 elements would, confusingly, be displayed as the empty
/// string. It defaults to the string `[]`.
/// The [ifEmpty] argument is used to indicate how an iterable [value] with 0
/// elements is displayed. If [ifEmpty] equals `null` that indicates that an
/// empty iterable [value] is not interesting to display similar to how
/// [defaultValue] is used to indicate that a specific concrete value is not
/// interesting to display.
///
/// The [style], [hidden], and [showName] arguments must also not be null.
/// The [style], [showName], and [level] arguments must not be null.
IterableProperty(String name, Iterable<T> value, {
Object defaultValue: kNoDefaultValue,
String ifNull,
String ifEmpty: '[]',
DiagnosticsTreeStyle style: DiagnosticsTreeStyle.singleLine,
bool hidden: false,
bool showName: true,
}) : assert(ifEmpty != null),
assert(style != null),
assert(hidden != null),
DiagnosticLevel level: DiagnosticLevel.info,
}) : assert(style != null),
assert(showName != null),
assert(level != null),
super(
name,
value,
......@@ -1272,8 +1401,8 @@ class IterableProperty<T> extends DiagnosticsProperty<Iterable<T>> {
ifNull: ifNull,
ifEmpty: ifEmpty,
style: style,
hidden: hidden,
showName: showName,
level: level,
);
@override
......@@ -1281,6 +1410,9 @@ class IterableProperty<T> extends DiagnosticsProperty<Iterable<T>> {
if (value == null)
return value.toString();
if (value.isEmpty)
return ifEmpty ?? '[]';
if (parentConfiguration != null && !parentConfiguration.lineBreakProperties) {
// Always display the value as a single line and enclose the iterable
// value in brackets to avoid ambiguity.
......@@ -1289,6 +1421,20 @@ class IterableProperty<T> extends DiagnosticsProperty<Iterable<T>> {
return value.join(style == DiagnosticsTreeStyle.singleLine ? ', ' : '\n');
}
/// Priority level of the diagnostic used to control which diagnostics should
/// be shown and filtered.
///
/// If [ifEmpty] is `null` and the [value] is an empty [Iterable] then level
/// [DiagnosticLevel.fine] is returned in a similar way to how an
/// [ObjectFlagProperty] handles when [ifNull] is `null` and the [value] is
/// `null`.
@override
DiagnosticLevel get level {
if (ifEmpty == null && value != null && value.isEmpty && super.level != DiagnosticLevel.hidden)
return DiagnosticLevel.fine;
return super.level;
}
}
/// An property than displays enum values tersely.
......@@ -1303,15 +1449,16 @@ class IterableProperty<T> extends DiagnosticsProperty<Iterable<T>> {
class EnumProperty<T> extends DiagnosticsProperty<T> {
/// Create a diagnostics property that displays an enum.
///
/// The [hidden] argument must not be null.
/// The [level] argument must also not be null.
EnumProperty(String name, T value, {
Object defaultValue: kNoDefaultValue,
bool hidden: false,
}) : super (
DiagnosticLevel level : DiagnosticLevel.info,
}) : assert(level != null),
super (
name,
value,
defaultValue: defaultValue,
hidden: hidden,
level: level,
);
@override
......@@ -1328,8 +1475,8 @@ class EnumProperty<T> extends DiagnosticsProperty<T> {
///
/// The [ifPresent] and [ifNull] strings describe the property [value] when it
/// is non-null and null respectively. If one of [ifPresent] or [ifNull] is
/// omitted, that is taken to mean that [hidden] should be true when [value] is
/// non-null or null respectively.
/// omitted, that is taken to mean that [level] should be
/// [DiagnosticsLevel.hidden] when [value] is non-null or null respectively.
///
/// This kind of diagnostics property is typically used for values mostly opaque
/// values, like closures, where presenting the actual object is of dubious
......@@ -1345,59 +1492,86 @@ class ObjectFlagProperty<T> extends DiagnosticsProperty<T> {
/// absent (null), but for which the exact value's [Object.toString]
/// representation is not very transparent (e.g. a callback).
///
/// The [showName] and [hidden] arguments must not be null. Additionally, at
/// The [showName] and [level] arguments must not be null. Additionally, at
/// least one of [ifPresent] and [ifNull] must not be null.
ObjectFlagProperty(String name, T value, {
this.ifPresent,
String ifNull,
bool showName: false,
bool hidden: false,
DiagnosticLevel level : DiagnosticLevel.info,
}) : assert(ifPresent != null || ifNull != null),
assert(showName != null),
assert(hidden != null),
assert(level != null),
super(
name,
value,
showName: showName,
hidden: hidden,
ifNull: ifNull,
level: level,
);
/// Shorthand constructor to describe whether the property has a value.
///
/// Only use if prefixing the property name with the word 'has' is a good
/// flag name.
///
/// The [name] and [level] arguments must not be null.
ObjectFlagProperty.has(
String name,
T value,
) : ifPresent = 'has $name',
super(
name,
value,
showName: false,
);
T value, {
DiagnosticLevel level: DiagnosticLevel.info,
}) : assert(name != null),
assert(level != null),
ifPresent = 'has $name',
super(
name,
value,
showName: false,
level: level,
);
/// Description to use if the property [value] is not null.
///
/// If the property [value] is not null and [ifPresent] is null, the
/// description returns the empty string and the property is [hidden].
/// [level] for the property is [DiagnosticsLevel.hidden] and the description
/// from superclass is used.
final String ifPresent;
@override
String valueToString({ TextTreeConfiguration parentConfiguration }) {
if (value != null)
return ifPresent ?? '';
return ifNull ?? '';
if (value != null) {
if (ifPresent != null)
return ifPresent;
} else {
if (ifNull != null)
return ifNull;
}
return super.valueToString(parentConfiguration: parentConfiguration);
}
@override
bool get hidden {
if (super.hidden)
bool get showName {
if ((value != null && ifPresent == null) || (value == null && ifNull == null)) {
// We are missing a description for the flag value so we need to show the
// flag name. The property will have DiagnosticLevel.hidden for this case
// so users will not see this the property in this case unless they are
// displaying hidden properties.
return true;
if (value != null)
return ifPresent == null;
return ifNull == null;
}
return super.showName;
}
@override
DiagnosticLevel get level {
if (value != null) {
if (ifPresent == null)
return DiagnosticLevel.hidden;
} else {
if (ifNull == null)
return DiagnosticLevel.hidden;
}
return super.level;
}
}
......@@ -1413,36 +1587,41 @@ typedef T ComputePropertyValueCallback<T>();
/// If the default `value.toString()` does not provide an adequate description
/// of the value, specify `description` defining a custom description.
///
/// The [hidden] property specifies whether the property should be hidden from
/// the default output (e.g. the output given by [toStringDeep]).
///
/// The [showSeparator] property indicates whether a separator should be placed
/// between the property [name] and its [value].
class DiagnosticsProperty<T> extends DiagnosticsNode {
/// Create a diagnostics property.
///
/// The [hidden], [showName], [showSeparator], and [style] arguments must not be null.
/// The [showName], [showSeparator], [style], [missingIfNull], and [level]
/// arguments must not be null.
///
/// The [level] argument is just a suggestion and can be overridden if
/// something else about the property causes it to have a lower or higher
/// level. For example, if the property value is `null` and [missingIfNull] is
/// `true`, [level] is raised to [DiagnosticLevel.warning].
DiagnosticsProperty(
String name,
T value, {
String description,
bool hidden: false,
this.ifNull,
String ifNull,
this.ifEmpty,
bool showName: true,
bool showSeparator: true,
this.defaultValue: kNoDefaultValue,
this.tooltip,
this.missingIfNull: false,
DiagnosticsTreeStyle style: DiagnosticsTreeStyle.singleLine,
}) : assert(hidden != null),
assert(showName != null),
DiagnosticLevel level: DiagnosticLevel.info,
}) : assert(showName != null),
assert(showSeparator != null),
assert(style != null),
assert(level != null),
_description = description,
_valueComputed = true,
_value = value,
_computeValue = null,
_hidden = hidden,
ifNull = ifNull ?? (missingIfNull ? 'MISSING' : null),
_defaultLevel = level,
super(
name: name,
showName: showName,
......@@ -1455,30 +1634,38 @@ class DiagnosticsProperty<T> extends DiagnosticsNode {
/// Use if computing the property [value] may throw an exception or is
/// expensive.
///
/// The [hidden], [showName], [showSeparator], and [style] arguments must not
/// be null.
/// The [showName], [showSeparator], [style], [missingIfNull], and [level]
/// arguments must not be null.
///
/// The [level] argument is just a suggestion and can be overridden if
/// if something else about the property causes it to have a lower or higher
/// level. For example, if calling `computeValue` throws an exception, [level]
/// will always return [DiagnosticLevel.error].
DiagnosticsProperty.lazy(
String name,
ComputePropertyValueCallback<T> computeValue, {
String description,
bool hidden: false,
this.ifNull,
String ifNull,
this.ifEmpty,
bool showName: true,
bool showSeparator: true,
this.defaultValue: kNoDefaultValue,
this.tooltip,
this.missingIfNull: false,
DiagnosticsTreeStyle style: DiagnosticsTreeStyle.singleLine,
}) : assert(hidden != null),
assert(showName != null),
DiagnosticLevel level: DiagnosticLevel.info,
}) : assert(showName != null),
assert(showSeparator != null),
assert(defaultValue == kNoDefaultValue || defaultValue is T),
assert(missingIfNull != null),
assert(style != null),
assert(level != null),
_description = description,
_valueComputed = false,
_value = null,
_computeValue = computeValue,
_hidden = hidden,
_defaultLevel = level,
ifNull = ifNull ?? (missingIfNull ? 'MISSING' : null),
super(
name: name,
showName: showName,
......@@ -1550,6 +1737,10 @@ class DiagnosticsProperty<T> extends DiagnosticsNode {
/// generating the string description.
final String tooltip;
/// Whether a [value] of null causes the property to have [level]
/// [DiagnosticLevel.warning] warning that the property is missing a [value].
final bool missingIfNull;
/// The type of the property [value].
///
/// This is determined from the type argument `T` used to instantiate the
......@@ -1607,29 +1798,41 @@ class DiagnosticsProperty<T> extends DiagnosticsNode {
}
}
/// If the [value] of the property equals [defaultValue] the property is
/// [hidden] as the [value] is uninteresting.
/// If the [value] of the property equals [defaultValue] the priority [level]
/// of the property is downgraded to [DiagnosticLevel.fine] as the property
/// value is uninteresting.
///
/// [defaultValue] has type [T] or is [kNoDefaultValue].
final Object defaultValue;
final bool _hidden;
DiagnosticLevel _defaultLevel;
/// Whether the property should be hidden when showing the default
/// view of a tree.
/// Priority level of the diagnostic used to control which diagnostics should
/// be shown and filtered.
///
/// This could be set to true (hiding the property) if another property
/// provides a normally more useful summary of the value.
/// The property level defaults to the value specified by the `level`
/// constructor argument. The level is raised to [DiagnosticLevel.error] if
/// an [exception] was thrown getting the property [value]. The level is
/// raised to [DiagnosticLevel.warning] if the property [value] is null and
/// the property is not allowed to be null due to [missingIfNull]. The
/// priority level is lowered to [DiagnosticLevel.fine] if the property
/// [value] equals [defaultValue].
@override
bool get hidden {
if (_hidden)
return true;
if (defaultValue != kNoDefaultValue) {
if (exception != null)
return false;
return value == defaultValue;
}
return false;
DiagnosticLevel get level {
if (_defaultLevel == DiagnosticLevel.hidden)
return _defaultLevel;
if (exception != null)
return DiagnosticLevel.error;
if (value == null && missingIfNull)
return DiagnosticLevel.warning;
// Use a low level when the value matches the default value.
if (defaultValue != kNoDefaultValue && value == defaultValue)
return DiagnosticLevel.fine;
return _defaultLevel;
}
final ComputePropertyValueCallback<T> _computeValue;
......@@ -1690,8 +1893,6 @@ class DiagnosticableNode<T extends Diagnosticable> extends DiagnosticsNode {
String toDescription({ TextTreeConfiguration parentConfiguration }) {
return value.toStringShort();
}
@override bool get hidden => false;
}
/// [DiagnosticsNode] for an instance of [DiagnosticableTree].
......@@ -1839,8 +2040,9 @@ abstract class Diagnosticable {
/// * [toString], for a detailed description of the object.
String toStringShort() => describeIdentity(this);
@override String toString() {
return toDiagnosticsNode(style: DiagnosticsTreeStyle.singleLine).toString();
@override
String toString({ DiagnosticLevel minLevel: DiagnosticLevel.debug }) {
return toDiagnosticsNode(style: DiagnosticsTreeStyle.singleLine).toString(minLevel: minLevel);
}
/// Returns a debug representation of the object that is used by debugging
......@@ -1870,14 +2072,14 @@ abstract class Diagnosticable {
/// Common named parameters in [DiagnosticsNode] subclasses help filter when
/// and how properties are displayed.
///
/// `defaultValue`, `showName`, `showSeparator`, and `hidden` keep string
/// `defaultValue`, `showName`, `showSeparator`, and `level` keep string
/// representations of diagnostics terse and hide properties when they are not
/// very useful.
///
/// * Use `defaultValue` any time the default value of a property is
/// uninteresting. For example, specify a default value of null any time
/// a property being null does not indicate an error.
/// * Avoid specifying the `hidden` parameter unless the result you want
/// * Avoid specifying the `level` parameter unless the result you want
/// cannot be be achieved by using the `defaultValue` parameter or using
/// the [ObjectFlagProperty] class to conditionally display the property
/// as a flag.
......@@ -2091,39 +2293,52 @@ abstract class DiagnosticableTree extends Diagnosticable {
/// This description is often somewhat long. This includes the same
/// information given by [toStringDeep], but does not recurse to any children.
///
/// The [toStringShallow] method can take an argument, which is the string to
/// place between each part obtained from [debugFillProperties]. Passing a
/// string such as `'\n '` will result in a multiline string that indents the
/// properties of the object below its name (as per [toString]).
/// `joiner` specifies the string which is place between each part obtained
/// from [debugFillProperties]. Passing a string such as `'\n '` will result
/// in a multiline string that indents the properties of the object below its
/// name (as per [toString]).
///
/// `minLevel` specifies the minimum [DiagnosticLevel] for properties included
/// in the output.
///
/// See also:
///
/// * [toString], for a brief description of the object.
/// * [toStringDeep], for a description of the subtree rooted at this object.
String toStringShallow([String joiner = ', ']) {
String toStringShallow({
String joiner: ', ',
DiagnosticLevel minLevel: DiagnosticLevel.debug,
}) {
final StringBuffer result = new StringBuffer();
result.write(toString());
result.write(joiner);
final DiagnosticPropertiesBuilder builder = new DiagnosticPropertiesBuilder();
debugFillProperties(builder);
result.write(
builder.properties.where((DiagnosticsNode n) => !n.hidden).join(joiner),
builder.properties.where((DiagnosticsNode n) => !n.isFiltered(minLevel)).join(joiner),
);
return result.toString();
}
/// Returns a string representation of this node and its descendants.
///
/// The [toStringDeep] method takes arguments, but those are intended for
/// internal use when recursing to the descendants, and so can be ignored.
/// `minLevel` specifies the minimum [DiagnosticLevel] for properties included
/// in the output.
///
/// The [toStringDeep] method takes other arguments, but those are intended
/// for internal use when recursing to the descendants, and so can be ignored.
///
/// See also:
///
/// * [toString], for a brief description of the object but not its children.
/// * [toStringShallow], for a detailed description of the object but not its
/// children.
String toStringDeep({ String prefixLineOne: '', String prefixOtherLines }) {
return toDiagnosticsNode().toStringDeep(prefixLineOne: prefixLineOne, prefixOtherLines: prefixOtherLines);
String toStringDeep({
String prefixLineOne: '',
String prefixOtherLines,
DiagnosticLevel minLevel: DiagnosticLevel.debug,
}) {
return toDiagnosticsNode().toStringDeep(prefixLineOne: prefixLineOne, prefixOtherLines: prefixOtherLines, minLevel: minLevel);
}
@override
......@@ -2170,26 +2385,33 @@ abstract class DiagnosticableTreeMixin implements DiagnosticableTree {
factory DiagnosticableTreeMixin._() => null;
@override
String toString() {
return toDiagnosticsNode(style: DiagnosticsTreeStyle.singleLine).toString();
String toString({ DiagnosticLevel minLevel: DiagnosticLevel.debug }) {
return toDiagnosticsNode(style: DiagnosticsTreeStyle.singleLine).toString(minLevel: minLevel);
}
@override
String toStringShallow([String joiner = ', ']) {
String toStringShallow({
String joiner: ', ',
DiagnosticLevel minLevel: DiagnosticLevel.debug,
}) {
final StringBuffer result = new StringBuffer();
result.write(toStringShort());
result.write(joiner);
final DiagnosticPropertiesBuilder builder = new DiagnosticPropertiesBuilder();
debugFillProperties(builder);
result.write(
builder.properties.where((DiagnosticsNode n) => !n.hidden).join(joiner),
builder.properties.where((DiagnosticsNode n) => !n.isFiltered(minLevel)).join(joiner),
);
return result.toString();
}
@override
String toStringDeep({ String prefixLineOne: '', String prefixOtherLines }) {
return toDiagnosticsNode().toStringDeep(prefixLineOne: prefixLineOne, prefixOtherLines: prefixOtherLines);
String toStringDeep({
String prefixLineOne: '',
String prefixOtherLines,
DiagnosticLevel minLevel: DiagnosticLevel.debug,
}) {
return toDiagnosticsNode().toStringDeep(prefixLineOne: prefixLineOne, prefixOtherLines: prefixOtherLines, minLevel: minLevel);
}
@override
......
......@@ -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,16 +146,20 @@ 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(
name,
value,
showName: showName,
defaultValue: defaultValue,
);
DiagnosticLevel level: DiagnosticLevel.info,
}) : assert(showName != null),
assert(level != null),
super(
name,
value,
showName: showName,
defaultValue: defaultValue,
level: level,
);
@override
String valueToString({ TextTreeConfiguration parentConfiguration }) {
......
......@@ -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));
}
......
......@@ -193,7 +193,7 @@ void main() {
new StringProperty('stringProperty1', 'value1', quoted: false),
new DoubleProperty('doubleProperty1', 42.5),
new DoubleProperty('roundedProperty', 1.0 / 3.0),
new StringProperty('DO_NOT_SHOW', 'DO_NOT_SHOW', hidden: true, quoted: false),
new StringProperty('DO_NOT_SHOW', 'DO_NOT_SHOW', level: DiagnosticLevel.hidden, quoted: false),
new DiagnosticsProperty<Object>('DO_NOT_SHOW_NULL', null, defaultValue: null),
new DiagnosticsProperty<Object>('nullProperty', null),
new StringProperty('node_type', '<root node>', showName: false, quoted: false),
......@@ -590,9 +590,9 @@ void main() {
equals('<hidden>'),
);
expect(new StringProperty('name', null).hidden, isFalse);
expect(new StringProperty('name', 'value', hidden: true).hidden, isTrue);
expect(new StringProperty('name', null, defaultValue: null).hidden, isTrue);
expect(new StringProperty('name', null).isFiltered(DiagnosticLevel.info), isFalse);
expect(new StringProperty('name', 'value', level: DiagnosticLevel.hidden).isFiltered(DiagnosticLevel.info), isTrue);
expect(new StringProperty('name', null, defaultValue: null).isFiltered(DiagnosticLevel.info), isTrue);
expect(
new StringProperty(
'name',
......@@ -622,11 +622,11 @@ void main() {
final DiagnosticsProperty<bool> trueProperty = new DiagnosticsProperty<bool>('name', true);
final DiagnosticsProperty<bool> falseProperty = new DiagnosticsProperty<bool>('name', false);
expect(trueProperty.toString(), equals('name: true'));
expect(trueProperty.hidden, isFalse);
expect(trueProperty.isFiltered(DiagnosticLevel.info), isFalse);
expect(trueProperty.value, isTrue);
expect(falseProperty.toString(), equals('name: false'));
expect(falseProperty.value, isFalse);
expect(falseProperty.hidden, isFalse);
expect(falseProperty.isFiltered(DiagnosticLevel.info), isFalse);
expect(
new DiagnosticsProperty<bool>(
'name',
......@@ -640,9 +640,9 @@ void main() {
equals('true'),
);
expect(new DiagnosticsProperty<bool>('name', null).hidden, isFalse);
expect(new DiagnosticsProperty<bool>('name', true, hidden: true).hidden, isTrue);
expect(new DiagnosticsProperty<bool>('name', null, defaultValue: null).hidden, isTrue);
expect(new DiagnosticsProperty<bool>('name', null).isFiltered(DiagnosticLevel.info), isFalse);
expect(new DiagnosticsProperty<bool>('name', true, level: DiagnosticLevel.hidden).isFiltered(DiagnosticLevel.info), isTrue);
expect(new DiagnosticsProperty<bool>('name', null, defaultValue: null).isFiltered(DiagnosticLevel.info), isTrue);
expect(
new DiagnosticsProperty<bool>('name', null, ifNull: 'missing').toString(),
equals('name: missing'),
......@@ -665,8 +665,8 @@ void main() {
expect(trueFlag.value, isTrue);
expect(falseFlag.value, isFalse);
expect(trueFlag.hidden, isFalse);
expect(falseFlag.hidden, isTrue);
expect(trueFlag.isFiltered(DiagnosticLevel.fine), isFalse);
expect(falseFlag.isFiltered(DiagnosticLevel.fine), isTrue);
});
test('property with tooltip test', () {
......@@ -680,7 +680,7 @@ void main() {
equals('name: value (tooltip)'),
);
expect(withTooltip.value, equals('value'));
expect(withTooltip.hidden, isFalse);
expect(withTooltip.isFiltered(DiagnosticLevel.fine), isFalse);
});
test('double property test', () {
......@@ -689,13 +689,13 @@ void main() {
42.0,
);
expect(doubleProperty.toString(), equals('name: 42.0'));
expect(doubleProperty.hidden, isFalse);
expect(doubleProperty.isFiltered(DiagnosticLevel.info), isFalse);
expect(doubleProperty.value, equals(42.0));
expect(new DoubleProperty('name', 1.3333).toString(), equals('name: 1.3'));
expect(new DoubleProperty('name', null).toString(), equals('name: null'));
expect(new DoubleProperty('name', null).hidden, equals(false));
expect(new DoubleProperty('name', null).isFiltered(DiagnosticLevel.info), equals(false));
expect(
new DoubleProperty('name', null, ifNull: 'missing').toString(),
......@@ -716,7 +716,7 @@ void main() {
() => 42.0,
);
expect(safe.toString(), equals('name: 42.0'));
expect(safe.hidden, isFalse);
expect(safe.isFiltered(DiagnosticLevel.info), isFalse);
expect(safe.value, equals(42.0));
expect(
......@@ -729,7 +729,7 @@ void main() {
equals('name: null'),
);
expect(
new DoubleProperty.lazy('name', () => null).hidden,
new DoubleProperty.lazy('name', () => null).isFiltered(DiagnosticLevel.info),
equals(false),
);
......@@ -740,11 +740,12 @@ void main() {
// TODO(jacobr): it would be better if throwingProperty.object threw an
// exception.
expect(throwingProperty.value, isNull);
expect(throwingProperty.hidden, isFalse);
expect(throwingProperty.isFiltered(DiagnosticLevel.info), isFalse);
expect(
throwingProperty.toString(),
equals('name: EXCEPTION (FlutterError)'),
);
expect(throwingProperty.level, equals(DiagnosticLevel.error));
});
test('percent property', () {
......@@ -828,10 +829,10 @@ void main() {
);
expect(present.toString(), equals('clickable'));
expect(present.hidden, isFalse);
expect(present.isFiltered(DiagnosticLevel.info), isFalse);
expect(present.value, equals(onClick));
expect(missing.toString(), equals(''));
expect(missing.hidden, isTrue);
expect(missing.toString(), equals('onClick: null'));
expect(missing.isFiltered(DiagnosticLevel.fine), isTrue);
});
test('missing callback property test', () {
......@@ -847,11 +848,11 @@ void main() {
ifNull: 'disabled',
);
expect(present.toString(), equals(''));
expect(present.hidden, isTrue);
expect(present.toString(), equals('onClick: Closure: () => dynamic'));
expect(present.isFiltered(DiagnosticLevel.fine), isTrue);
expect(present.value, equals(onClick));
expect(missing.toString(), equals('disabled'));
expect(missing.hidden, isFalse);
expect(missing.isFiltered(DiagnosticLevel.info), isFalse);
});
test('describe bool property', () {
......@@ -870,10 +871,10 @@ void main() {
showName: true,
);
expect(yes.toString(), equals('name: YES'));
expect(yes.hidden, isFalse);
expect(yes.level, equals(DiagnosticLevel.info));
expect(yes.value, isTrue);
expect(no.toString(), equals('name: NO'));
expect(no.hidden, isFalse);
expect(no.level, equals(DiagnosticLevel.info));
expect(no.value, isFalse);
expect(
......@@ -902,10 +903,10 @@ void main() {
value: true,
ifTrue: 'YES',
ifFalse: 'NO',
hidden: true,
level: DiagnosticLevel.hidden,
showName: true,
).hidden,
isTrue,
).level,
equals(DiagnosticLevel.hidden),
);
});
......@@ -926,19 +927,19 @@ void main() {
'name',
null,
);
expect(hello.hidden, isFalse);
expect(hello.level, equals(DiagnosticLevel.info));
expect(hello.value, equals(ExampleEnum.hello));
expect(hello.toString(), equals('name: hello'));
expect(world.hidden, isFalse);
expect(world.level, equals(DiagnosticLevel.info));
expect(world.value, equals(ExampleEnum.world));
expect(world.toString(), equals('name: world'));
expect(deferToChild.hidden, isFalse);
expect(deferToChild.level, equals(DiagnosticLevel.info));
expect(deferToChild.value, equals(ExampleEnum.deferToChild));
expect(deferToChild.toString(), equals('name: defer-to-child'));
expect(nullEnum.hidden, isFalse);
expect(nullEnum.level, equals(DiagnosticLevel.info));
expect(nullEnum.value, isNull);
expect(nullEnum.toString(), equals('name: null'));
......@@ -949,16 +950,16 @@ void main() {
);
expect(matchesDefault.toString(), equals('name: hello'));
expect(matchesDefault.value, equals(ExampleEnum.hello));
expect(matchesDefault.hidden, isTrue);
expect(matchesDefault.isFiltered(DiagnosticLevel.info), isTrue);
expect(
new EnumProperty<ExampleEnum>(
'name',
ExampleEnum.hello,
hidden: true,
).hidden,
isTrue,
level: DiagnosticLevel.hidden,
).level,
equals(DiagnosticLevel.hidden),
);
});
......@@ -969,7 +970,7 @@ void main() {
);
expect(regular.toString(), equals('name: 42'));
expect(regular.value, equals(42));
expect(regular.hidden, isFalse);
expect(regular.level, equals(DiagnosticLevel.info));
final IntProperty nullValue = new IntProperty(
'name',
......@@ -977,16 +978,16 @@ void main() {
);
expect(nullValue.toString(), equals('name: null'));
expect(nullValue.value, isNull);
expect(nullValue.hidden, isFalse);
expect(nullValue.level, equals(DiagnosticLevel.info));
final IntProperty hideNull = new IntProperty(
'name',
null,
defaultValue: null
defaultValue: null,
);
expect(hideNull.toString(), equals('name: null'));
expect(hideNull.value, isNull);
expect(hideNull.hidden, isTrue);
expect(hideNull.isFiltered(DiagnosticLevel.info), isTrue);
final IntProperty nullDescription = new IntProperty(
'name',
......@@ -995,7 +996,7 @@ void main() {
);
expect(nullDescription.toString(), equals('name: missing'));
expect(nullDescription.value, isNull);
expect(nullDescription.hidden, isFalse);
expect(nullDescription.level, equals(DiagnosticLevel.info));
final IntProperty hideName = new IntProperty(
'name',
......@@ -1004,7 +1005,7 @@ void main() {
);
expect(hideName.toString(), equals('42'));
expect(hideName.value, equals(42));
expect(hideName.hidden, isFalse);
expect(hideName.level, equals(DiagnosticLevel.info));
final IntProperty withUnit = new IntProperty(
'name',
......@@ -1013,7 +1014,7 @@ void main() {
);
expect(withUnit.toString(), equals('name: 42pt'));
expect(withUnit.value, equals(42));
expect(withUnit.hidden, isFalse);
expect(withUnit.level, equals(DiagnosticLevel.info));
final IntProperty defaultValue = new IntProperty(
'name',
......@@ -1022,7 +1023,7 @@ void main() {
);
expect(defaultValue.toString(), equals('name: 42'));
expect(defaultValue.value, equals(42));
expect(defaultValue.hidden, isTrue);
expect(defaultValue.isFiltered(DiagnosticLevel.info), isTrue);
final IntProperty notDefaultValue = new IntProperty(
'name',
......@@ -1031,16 +1032,16 @@ void main() {
);
expect(notDefaultValue.toString(), equals('name: 43'));
expect(notDefaultValue.value, equals(43));
expect(notDefaultValue.hidden, isFalse);
expect(notDefaultValue.level, equals(DiagnosticLevel.info));
final IntProperty hidden = new IntProperty(
'name',
42,
hidden: true,
level: DiagnosticLevel.hidden,
);
expect(hidden.toString(), equals('name: 42'));
expect(hidden.value, equals(42));
expect(hidden.hidden, isTrue);
expect(hidden.level, equals(DiagnosticLevel.hidden));
});
test('object property test', () {
......@@ -1050,7 +1051,7 @@ void main() {
rect,
);
expect(simple.value, equals(rect));
expect(simple.hidden, isFalse);
expect(simple.level, equals(DiagnosticLevel.info));
expect(simple.toString(), equals('name: Rect.fromLTRB(0.0, 0.0, 20.0, 20.0)'));
final DiagnosticsNode withDescription = new DiagnosticsProperty<Rect>(
......@@ -1059,7 +1060,7 @@ void main() {
description: 'small rect',
);
expect(withDescription.value, equals(rect));
expect(withDescription.hidden, isFalse);
expect(withDescription.level, equals(DiagnosticLevel.info));
expect(withDescription.toString(), equals('name: small rect'));
final DiagnosticsProperty<Object> nullProperty = new DiagnosticsProperty<Object>(
......@@ -1067,7 +1068,7 @@ void main() {
null,
);
expect(nullProperty.value, isNull);
expect(nullProperty.hidden, isFalse);
expect(nullProperty.level, equals(DiagnosticLevel.info));
expect(nullProperty.toString(), equals('name: null'));
final DiagnosticsProperty<Object> hideNullProperty = new DiagnosticsProperty<Object>(
......@@ -1076,7 +1077,7 @@ void main() {
defaultValue: null,
);
expect(hideNullProperty.value, isNull);
expect(hideNullProperty.hidden, isTrue);
expect(hideNullProperty.isFiltered(DiagnosticLevel.info), isTrue);
expect(hideNullProperty.toString(), equals('name: null'));
final DiagnosticsNode nullDescription = new DiagnosticsProperty<Object>(
......@@ -1085,16 +1086,17 @@ void main() {
ifNull: 'missing',
);
expect(nullDescription.value, isNull);
expect(nullDescription.hidden, isFalse);
expect(nullDescription.level, equals(DiagnosticLevel.info));
expect(nullDescription.toString(), equals('name: missing'));
final DiagnosticsProperty<Rect> hideName = new DiagnosticsProperty<Rect>(
'name',
rect,
showName: false,
level: DiagnosticLevel.warning
);
expect(hideName.value, equals(rect));
expect(hideName.hidden, isFalse);
expect(hideName.level, equals(DiagnosticLevel.warning));
expect(hideName.toString(), equals('Rect.fromLTRB(0.0, 0.0, 20.0, 20.0)'));
final DiagnosticsProperty<Rect> hideSeparator = new DiagnosticsProperty<Rect>(
......@@ -1103,7 +1105,7 @@ void main() {
showSeparator: false,
);
expect(hideSeparator.value, equals(rect));
expect(hideSeparator.hidden, isFalse);
expect(hideSeparator.level, equals(DiagnosticLevel.info));
expect(
hideSeparator.toString(),
equals('Creator Rect.fromLTRB(0.0, 0.0, 20.0, 20.0)'),
......@@ -1118,7 +1120,7 @@ void main() {
description: 'small rect',
);
expect(simple.value, equals(rect));
expect(simple.hidden, isFalse);
expect(simple.level, equals(DiagnosticLevel.info));
expect(simple.toString(), equals('name: small rect'));
final DiagnosticsNode nullProperty = new DiagnosticsProperty<Object>.lazy(
......@@ -1127,7 +1129,7 @@ void main() {
description: 'missing',
);
expect(nullProperty.value, isNull);
expect(nullProperty.hidden, isFalse);
expect(nullProperty.isFiltered(DiagnosticLevel.info), isFalse);
expect(nullProperty.toString(), equals('name: missing'));
final DiagnosticsNode hideNullProperty = new DiagnosticsProperty<Object>.lazy(
......@@ -1137,7 +1139,7 @@ void main() {
defaultValue: null,
);
expect(hideNullProperty.value, isNull);
expect(hideNullProperty.hidden, isTrue);
expect(hideNullProperty.isFiltered(DiagnosticLevel.info), isTrue);
expect(hideNullProperty.toString(), equals('name: missing'));
final DiagnosticsNode hideName = new DiagnosticsProperty<Rect>.lazy(
......@@ -1147,7 +1149,7 @@ void main() {
showName: false,
);
expect(hideName.value, equals(rect));
expect(hideName.hidden, isFalse);
expect(hideName.isFiltered(DiagnosticLevel.info), isFalse);
expect(hideName.toString(), equals('small rect'));
final DiagnosticsProperty<Object> throwingWithDescription = new DiagnosticsProperty<Object>.lazy(
......@@ -1158,7 +1160,7 @@ void main() {
);
expect(throwingWithDescription.value, isNull);
expect(throwingWithDescription.exception, isFlutterError);
expect(throwingWithDescription.hidden, false);
expect(throwingWithDescription.isFiltered(DiagnosticLevel.info), false);
expect(throwingWithDescription.toString(), equals('name: missing'));
final DiagnosticsProperty<Object> throwingProperty = new DiagnosticsProperty<Object>.lazy(
......@@ -1168,7 +1170,7 @@ void main() {
);
expect(throwingProperty.value, isNull);
expect(throwingProperty.exception, isFlutterError);
expect(throwingProperty.hidden, false);
expect(throwingProperty.isFiltered(DiagnosticLevel.info), false);
expect(throwingProperty.toString(), equals('name: EXCEPTION (FlutterError)'));
});
......@@ -1181,7 +1183,7 @@ void main() {
'name',
color,
);
expect(simple.hidden, isFalse);
expect(simple.isFiltered(DiagnosticLevel.info), isFalse);
expect(simple.value, equals(color));
expect(simple.toString(), equals('name: Color(0xffffffff)'));
});
......@@ -1194,7 +1196,7 @@ void main() {
);
expect(show.name, equals('wasLayout'));
expect(show.value, isTrue);
expect(show.hidden, isFalse);
expect(show.isFiltered(DiagnosticLevel.info), isFalse);
expect(show.toString(), equals('layout computed'));
final FlagProperty hide = new FlagProperty(
......@@ -1204,8 +1206,18 @@ void main() {
);
expect(hide.name, equals('wasLayout'));
expect(hide.value, isFalse);
expect(hide.hidden, isTrue);
expect(hide.toString(), equals(''));
expect(hide.level, equals(DiagnosticLevel.hidden));
expect(hide.toString(), equals('wasLayout: false'));
final FlagProperty hideTrue = new FlagProperty(
'wasLayout',
value: true,
ifFalse: 'no layout computed',
);
expect(hideTrue.name, equals('wasLayout'));
expect(hideTrue.value, isTrue);
expect(hideTrue.level, equals(DiagnosticLevel.hidden));
expect(hideTrue.toString(), equals('wasLayout: true'));
});
test('has property test', () {
......@@ -1216,7 +1228,7 @@ void main() {
);
expect(has.name, equals('onClick'));
expect(has.value, equals(onClick));
expect(has.hidden, isFalse);
expect(has.isFiltered(DiagnosticLevel.info), isFalse);
expect(has.toString(), equals('has onClick'));
final ObjectFlagProperty<Function> missing = new ObjectFlagProperty<Function>.has(
......@@ -1225,8 +1237,8 @@ void main() {
);
expect(missing.name, equals('onClick'));
expect(missing.value, isNull);
expect(missing.hidden, isTrue);
expect(missing.toString(), equals(''));
expect(missing.isFiltered(DiagnosticLevel.info), isTrue);
expect(missing.toString(), equals('onClick: null'));
});
test('iterable property test', () {
......@@ -1236,7 +1248,7 @@ void main() {
ints,
);
expect(intsProperty.value, equals(ints));
expect(intsProperty.hidden, isFalse);
expect(intsProperty.isFiltered(DiagnosticLevel.info), isFalse);
expect(intsProperty.toString(), equals('ints: 1, 2, 3'));
final IterableProperty<Object> emptyProperty = new IterableProperty<Object>(
......@@ -1244,7 +1256,7 @@ void main() {
<Object>[],
);
expect(emptyProperty.value, isEmpty);
expect(emptyProperty.hidden, isFalse);
expect(emptyProperty.isFiltered(DiagnosticLevel.info), isFalse);
expect(emptyProperty.toString(), equals('name: []'));
final IterableProperty<Object> nullProperty = new IterableProperty<Object>(
......@@ -1252,7 +1264,7 @@ void main() {
null,
);
expect(nullProperty.value, isNull);
expect(nullProperty.hidden, isFalse);
expect(nullProperty.isFiltered(DiagnosticLevel.info), isFalse);
expect(nullProperty.toString(), equals('list: null'));
final IterableProperty<Object> hideNullProperty = new IterableProperty<Object>(
......@@ -1261,7 +1273,8 @@ void main() {
defaultValue: null,
);
expect(hideNullProperty.value, isNull);
expect(hideNullProperty.hidden, isTrue);
expect(hideNullProperty.isFiltered(DiagnosticLevel.info), isTrue);
expect(hideNullProperty.level, equals(DiagnosticLevel.fine));
expect(hideNullProperty.toString(), equals('list: null'));
final List<Object> objects = <Object>[
......@@ -1273,7 +1286,7 @@ void main() {
objects,
);
expect(objectsProperty.value, equals(objects));
expect(objectsProperty.hidden, isFalse);
expect(objectsProperty.isFiltered(DiagnosticLevel.info), isFalse);
expect(
objectsProperty.toString(),
equals('objects: Rect.fromLTRB(0.0, 0.0, 20.0, 20.0), Color(0xffffffff)'),
......@@ -1285,7 +1298,7 @@ void main() {
style: DiagnosticsTreeStyle.whitespace,
);
expect(multiLineProperty.value, equals(objects));
expect(multiLineProperty.hidden, isFalse);
expect(multiLineProperty.isFiltered(DiagnosticLevel.info), isFalse);
expect(
multiLineProperty.toString(),
equals(
......@@ -1335,7 +1348,7 @@ void main() {
style: DiagnosticsTreeStyle.whitespace,
);
expect(objectProperty.value, equals(singleElementList));
expect(objectProperty.hidden, isFalse);
expect(objectProperty.isFiltered(DiagnosticLevel.info), isFalse);
expect(
objectProperty.toString(),
equals('object: Color(0xffffffff)'),
......
......@@ -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'
......
......@@ -52,19 +52,296 @@ void main() {
expect(box, hasAGoodToStringDeep);
expect(
box.toStringDeep(),
box.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'RenderPadding#00000 relayoutBoundary=up1\n'
' │ parentData: offset=Offset(0.0, 0.0) (can use size)\n'
' │ constraints: BoxConstraints(0.0<=w<=800.0, 0.0<=h<=600.0)\n'
' │ size: Size(63.0, 88.0)\n'
' │ padding: EdgeInsets.all(5.0)\n'
' │\n'
' └─child: RenderConstrainedBox#00000 relayoutBoundary=up2\n'
' │ parentData: offset=Offset(5.0, 5.0) (can use size)\n'
' │ constraints: BoxConstraints(0.0<=w<=790.0, 0.0<=h<=590.0)\n'
' │ size: Size(53.0, 78.0)\n'
' │ additionalConstraints: BoxConstraints(w=53.0, h=78.0)\n'
' │\n'
' └─child: RenderDecoratedBox#00000\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=53.0, h=78.0)\n'
' │ size: Size(53.0, 78.0)\n'
' │ decoration: BoxDecoration:\n'
' │ color: Color(0x7f0000ff)\n'
' │ configuration: ImageConfiguration(bundle:\n'
' │ PlatformAssetBundle#00000(), devicePixelRatio: 1.0, platform:\n'
' │ android)\n'
' │\n'
' └─child: RenderDecoratedBox#00000\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=53.0, h=78.0)\n'
' │ size: Size(53.0, 78.0)\n'
' │ decoration: BoxDecoration:\n'
' │ color: Color(0xff00ff00)\n'
' │ configuration: ImageConfiguration(bundle:\n'
' │ PlatformAssetBundle#00000(), devicePixelRatio: 1.0, platform:\n'
' │ android)\n'
' │\n'
' └─child: RenderPadding#00000\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=53.0, h=78.0)\n'
' │ size: Size(53.0, 78.0)\n'
' │ padding: EdgeInsets.all(7.0)\n'
' │\n'
' └─child: RenderPositionedBox#00000\n'
' │ parentData: offset=Offset(7.0, 7.0) (can use size)\n'
' │ constraints: BoxConstraints(w=39.0, h=64.0)\n'
' │ size: Size(39.0, 64.0)\n'
' │ alignment: FractionalOffset.bottomRight\n'
' │ widthFactor: expand\n'
' │ heightFactor: expand\n'
' │\n'
' └─child: RenderConstrainedBox#00000 relayoutBoundary=up1\n'
' │ parentData: offset=Offset(14.0, 31.0) (can use size)\n'
' │ constraints: BoxConstraints(0.0<=w<=39.0, 0.0<=h<=64.0)\n'
' │ size: Size(25.0, 33.0)\n'
' │ additionalConstraints: BoxConstraints(w=25.0, h=33.0)\n'
' │\n'
' └─child: RenderDecoratedBox#00000\n'
' parentData: <none> (can use size)\n'
' constraints: BoxConstraints(w=25.0, h=33.0)\n'
' size: Size(25.0, 33.0)\n'
' decoration: BoxDecoration:\n'
' color: Color(0xffffff00)\n'
' configuration: ImageConfiguration(bundle:\n'
' PlatformAssetBundle#00000(), devicePixelRatio: 1.0, platform:\n'
' android)\n',
),
);
expect(
box.toStringDeep(minLevel: DiagnosticLevel.debug),
equalsIgnoringHashCodes(
'RenderPadding#00000 relayoutBoundary=up1\n'
' │ creator: Padding ← Container ← Align ← [root]\n'
' │ parentData: offset=Offset(0.0, 0.0) (can use size)\n'
' │ constraints: BoxConstraints(0.0<=w<=800.0, 0.0<=h<=600.0)\n'
' │ size: Size(63.0, 88.0)\n'
' │ padding: EdgeInsets.all(5.0)\n'
' │\n'
' └─child: RenderConstrainedBox#00000 relayoutBoundary=up2\n'
' │ creator: ConstrainedBox ← Padding ← Container ← Align ← [root]\n'
' │ parentData: offset=Offset(5.0, 5.0) (can use size)\n'
' │ constraints: BoxConstraints(0.0<=w<=790.0, 0.0<=h<=590.0)\n'
' │ size: Size(53.0, 78.0)\n'
' │ additionalConstraints: BoxConstraints(w=53.0, h=78.0)\n'
' │\n'
' └─child: RenderDecoratedBox#00000\n'
' │ creator: DecoratedBox ← ConstrainedBox ← Padding ← Container ←\n'
' │ Align ← [root]\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=53.0, h=78.0)\n'
' │ size: Size(53.0, 78.0)\n'
' │ decoration: BoxDecoration:\n'
' │ color: Color(0x7f0000ff)\n'
' │ configuration: ImageConfiguration(bundle:\n'
' │ PlatformAssetBundle#00000(), devicePixelRatio: 1.0, platform:\n'
' │ android)\n'
' │\n'
' └─child: RenderDecoratedBox#00000\n'
' │ creator: DecoratedBox ← DecoratedBox ← ConstrainedBox ← Padding ←\n'
' │ Container ← Align ← [root]\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=53.0, h=78.0)\n'
' │ size: Size(53.0, 78.0)\n'
' │ decoration: BoxDecoration:\n'
' │ color: Color(0xff00ff00)\n'
' │ configuration: ImageConfiguration(bundle:\n'
' │ PlatformAssetBundle#00000(), devicePixelRatio: 1.0, platform:\n'
' │ android)\n'
' │\n'
' └─child: RenderPadding#00000\n'
' │ creator: Padding ← DecoratedBox ← DecoratedBox ← ConstrainedBox ←\n'
' │ Padding ← Container ← Align ← [root]\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=53.0, h=78.0)\n'
' │ size: Size(53.0, 78.0)\n'
' │ padding: EdgeInsets.all(7.0)\n'
' │\n'
' └─child: RenderPositionedBox#00000\n'
' │ creator: Align ← Padding ← DecoratedBox ← DecoratedBox ←\n'
' │ ConstrainedBox ← Padding ← Container ← Align ← [root]\n'
' │ parentData: offset=Offset(7.0, 7.0) (can use size)\n'
' │ constraints: BoxConstraints(w=39.0, h=64.0)\n'
' │ size: Size(39.0, 64.0)\n'
' │ alignment: FractionalOffset.bottomRight\n'
' │ widthFactor: expand\n'
' │ heightFactor: expand\n'
' │\n'
' └─child: RenderConstrainedBox#00000 relayoutBoundary=up1\n'
' │ creator: SizedBox ← Align ← Padding ← DecoratedBox ← DecoratedBox\n'
' │ ← ConstrainedBox ← Padding ← Container ← Align ← [root]\n'
' │ parentData: offset=Offset(14.0, 31.0) (can use size)\n'
' │ constraints: BoxConstraints(0.0<=w<=39.0, 0.0<=h<=64.0)\n'
' │ size: Size(25.0, 33.0)\n'
' │ additionalConstraints: BoxConstraints(w=25.0, h=33.0)\n'
' │\n'
' └─child: RenderDecoratedBox#00000\n'
' creator: DecoratedBox ← SizedBox ← Align ← Padding ← DecoratedBox\n'
' ← DecoratedBox ← ConstrainedBox ← Padding ← Container ← Align ←\n'
' [root]\n'
' parentData: <none> (can use size)\n'
' constraints: BoxConstraints(w=25.0, h=33.0)\n'
' size: Size(25.0, 33.0)\n'
' decoration: BoxDecoration:\n'
' color: Color(0xffffff00)\n'
' configuration: ImageConfiguration(bundle:\n'
' PlatformAssetBundle#00000(), devicePixelRatio: 1.0, platform:\n'
' android)\n',
),
);
expect(
box.toStringDeep(minLevel: DiagnosticLevel.fine),
equalsIgnoringHashCodes(
'RenderPadding#00000 relayoutBoundary=up1\n'
' │ creator: Padding ← Container ← Align ← [root]\n'
' │ parentData: offset=Offset(0.0, 0.0) (can use size)\n'
' │ constraints: BoxConstraints(0.0<=w<=800.0, 0.0<=h<=600.0)\n'
' │ layer: null\n'
' │ semantics node: null\n'
' │ size: Size(63.0, 88.0)\n'
' │ padding: EdgeInsets.all(5.0)\n'
' │ textDirection: null\n'
' │\n'
' └─child: RenderConstrainedBox#00000 relayoutBoundary=up2\n'
' │ creator: ConstrainedBox ← Padding ← Container ← Align ← [root]\n'
' │ parentData: offset=Offset(5.0, 5.0) (can use size)\n'
' │ constraints: BoxConstraints(0.0<=w<=790.0, 0.0<=h<=590.0)\n'
' │ layer: null\n'
' │ semantics node: null\n'
' │ size: Size(53.0, 78.0)\n'
' │ additionalConstraints: BoxConstraints(w=53.0, h=78.0)\n'
' │\n'
' └─child: RenderDecoratedBox#00000\n'
' │ creator: DecoratedBox ← ConstrainedBox ← Padding ← Container ←\n'
' │ Align ← [root]\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=53.0, h=78.0)\n'
' │ layer: null\n'
' │ semantics node: null\n'
' │ size: Size(53.0, 78.0)\n'
' │ decoration: BoxDecoration:\n'
' │ color: Color(0x7f0000ff)\n'
' │ image: null\n'
' │ border: null\n'
' │ borderRadius: null\n'
' │ boxShadow: null\n'
' │ gradient: null\n'
' │ shape: rectangle\n'
' │ configuration: ImageConfiguration(bundle:\n'
' │ PlatformAssetBundle#00000(), devicePixelRatio: 1.0, platform:\n'
' │ android)\n'
' │\n'
' └─child: RenderDecoratedBox#00000\n'
' │ creator: DecoratedBox ← DecoratedBox ← ConstrainedBox ← Padding ←\n'
' │ Container ← Align ← [root]\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=53.0, h=78.0)\n'
' │ layer: null\n'
' │ semantics node: null\n'
' │ size: Size(53.0, 78.0)\n'
' │ decoration: BoxDecoration:\n'
' │ color: Color(0xff00ff00)\n'
' │ image: null\n'
' │ border: null\n'
' │ borderRadius: null\n'
' │ boxShadow: null\n'
' │ gradient: null\n'
' │ shape: rectangle\n'
' │ configuration: ImageConfiguration(bundle:\n'
' │ PlatformAssetBundle#00000(), devicePixelRatio: 1.0, platform:\n'
' │ android)\n'
' │\n'
' └─child: RenderPadding#00000\n'
' │ creator: Padding ← DecoratedBox ← DecoratedBox ← ConstrainedBox ←\n'
' │ Padding ← Container ← Align ← [root]\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=53.0, h=78.0)\n'
' │ layer: null\n'
' │ semantics node: null\n'
' │ size: Size(53.0, 78.0)\n'
' │ padding: EdgeInsets.all(7.0)\n'
' │ textDirection: null\n'
' │\n'
' └─child: RenderPositionedBox#00000\n'
' │ creator: Align ← Padding ← DecoratedBox ← DecoratedBox ←\n'
' │ ConstrainedBox ← Padding ← Container ← Align ← [root]\n'
' │ parentData: offset=Offset(7.0, 7.0) (can use size)\n'
' │ constraints: BoxConstraints(w=39.0, h=64.0)\n'
' │ layer: null\n'
' │ semantics node: null\n'
' │ size: Size(39.0, 64.0)\n'
' │ alignment: FractionalOffset.bottomRight\n'
' │ textDirection: null\n'
' │ widthFactor: expand\n'
' │ heightFactor: expand\n'
' │\n'
' └─child: RenderConstrainedBox#00000 relayoutBoundary=up1\n'
' │ creator: SizedBox ← Align ← Padding ← DecoratedBox ← DecoratedBox\n'
' │ ← ConstrainedBox ← Padding ← Container ← Align ← [root]\n'
' │ parentData: offset=Offset(14.0, 31.0) (can use size)\n'
' │ constraints: BoxConstraints(0.0<=w<=39.0, 0.0<=h<=64.0)\n'
' │ layer: null\n'
' │ semantics node: null\n'
' │ size: Size(25.0, 33.0)\n'
' │ additionalConstraints: BoxConstraints(w=25.0, h=33.0)\n'
' │\n'
' └─child: RenderDecoratedBox#00000\n'
' creator: DecoratedBox ← SizedBox ← Align ← Padding ← DecoratedBox\n'
' ← DecoratedBox ← ConstrainedBox ← Padding ← Container ← Align ←\n'
' [root]\n'
' parentData: <none> (can use size)\n'
' constraints: BoxConstraints(w=25.0, h=33.0)\n'
' layer: null\n'
' semantics node: null\n'
' size: Size(25.0, 33.0)\n'
' decoration: BoxDecoration:\n'
' color: Color(0xffffff00)\n'
' image: null\n'
' border: null\n'
' borderRadius: null\n'
' boxShadow: null\n'
' gradient: null\n'
' shape: rectangle\n'
' configuration: ImageConfiguration(bundle:\n'
' PlatformAssetBundle#00000(), devicePixelRatio: 1.0, platform:\n'
' android)\n',
),
);
expect(
box.toStringDeep(minLevel: DiagnosticLevel.hidden),
equalsIgnoringHashCodes(
'RenderPadding#00000 relayoutBoundary=up1\n'
' │ creator: Padding ← Container ← Align ← [root]\n'
' │ parentData: offset=Offset(0.0, 0.0) (can use size)\n'
' │ constraints: BoxConstraints(0.0<=w<=800.0, 0.0<=h<=600.0)\n'
' │ layer: null\n'
' │ semantics node: null\n'
' │ isBlockingSemanticsOfPreviouslyPaintedNodes: false\n'
' │ isSemanticBoundary: false\n'
' │ size: Size(63.0, 88.0)\n'
' │ padding: EdgeInsets.all(5.0)\n'
' │ textDirection: null\n'
' │\n'
' └─child: RenderConstrainedBox#00000 relayoutBoundary=up2\n'
' │ creator: ConstrainedBox ← Padding ← Container ← Align ← [root]\n'
' │ parentData: offset=Offset(5.0, 5.0) (can use size)\n'
' │ constraints: BoxConstraints(0.0<=w<=790.0, 0.0<=h<=590.0)\n'
' │ layer: null\n'
' │ semantics node: null\n'
' │ isBlockingSemanticsOfPreviouslyPaintedNodes: false\n'
' │ isSemanticBoundary: false\n'
' │ size: Size(53.0, 78.0)\n'
' │ additionalConstraints: BoxConstraints(w=53.0, h=78.0)\n'
' │\n'
......@@ -73,9 +350,19 @@ void main() {
' │ Align ← [root]\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=53.0, h=78.0)\n'
' │ layer: null\n'
' │ semantics node: null\n'
' │ isBlockingSemanticsOfPreviouslyPaintedNodes: false\n'
' │ isSemanticBoundary: false\n'
' │ size: Size(53.0, 78.0)\n'
' │ decoration: BoxDecoration:\n'
' │ color: Color(0x7f0000ff)\n'
' │ image: null\n'
' │ border: null\n'
' │ borderRadius: null\n'
' │ boxShadow: null\n'
' │ gradient: null\n'
' │ shape: rectangle\n'
' │ configuration: ImageConfiguration(bundle:\n'
' │ PlatformAssetBundle#00000(), devicePixelRatio: 1.0, platform:\n'
' │ android)\n'
......@@ -85,9 +372,19 @@ void main() {
' │ Container ← Align ← [root]\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=53.0, h=78.0)\n'
' │ layer: null\n'
' │ semantics node: null\n'
' │ isBlockingSemanticsOfPreviouslyPaintedNodes: false\n'
' │ isSemanticBoundary: false\n'
' │ size: Size(53.0, 78.0)\n'
' │ decoration: BoxDecoration:\n'
' │ color: Color(0xff00ff00)\n'
' │ image: null\n'
' │ border: null\n'
' │ borderRadius: null\n'
' │ boxShadow: null\n'
' │ gradient: null\n'
' │ shape: rectangle\n'
' │ configuration: ImageConfiguration(bundle:\n'
' │ PlatformAssetBundle#00000(), devicePixelRatio: 1.0, platform:\n'
' │ android)\n'
......@@ -97,16 +394,26 @@ void main() {
' │ Padding ← Container ← Align ← [root]\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=53.0, h=78.0)\n'
' │ layer: null\n'
' │ semantics node: null\n'
' │ isBlockingSemanticsOfPreviouslyPaintedNodes: false\n'
' │ isSemanticBoundary: false\n'
' │ size: Size(53.0, 78.0)\n'
' │ padding: EdgeInsets.all(7.0)\n'
' │ textDirection: null\n'
' │\n'
' └─child: RenderPositionedBox#00000\n'
' │ creator: Align ← Padding ← DecoratedBox ← DecoratedBox ←\n'
' │ ConstrainedBox ← Padding ← Container ← Align ← [root]\n'
' │ parentData: offset=Offset(7.0, 7.0) (can use size)\n'
' │ constraints: BoxConstraints(w=39.0, h=64.0)\n'
' │ layer: null\n'
' │ semantics node: null\n'
' │ isBlockingSemanticsOfPreviouslyPaintedNodes: false\n'
' │ isSemanticBoundary: false\n'
' │ size: Size(39.0, 64.0)\n'
' │ alignment: FractionalOffset.bottomRight\n'
' │ textDirection: null\n'
' │ widthFactor: expand\n'
' │ heightFactor: expand\n'
' │\n'
......@@ -115,6 +422,10 @@ void main() {
' │ ← ConstrainedBox ← Padding ← Container ← Align ← [root]\n'
' │ parentData: offset=Offset(14.0, 31.0) (can use size)\n'
' │ constraints: BoxConstraints(0.0<=w<=39.0, 0.0<=h<=64.0)\n'
' │ layer: null\n'
' │ semantics node: null\n'
' │ isBlockingSemanticsOfPreviouslyPaintedNodes: false\n'
' │ isSemanticBoundary: false\n'
' │ size: Size(25.0, 33.0)\n'
' │ additionalConstraints: BoxConstraints(w=25.0, h=33.0)\n'
' │\n'
......@@ -124,9 +435,19 @@ void main() {
' [root]\n'
' parentData: <none> (can use size)\n'
' constraints: BoxConstraints(w=25.0, h=33.0)\n'
' layer: null\n'
' semantics node: null\n'
' isBlockingSemanticsOfPreviouslyPaintedNodes: false\n'
' isSemanticBoundary: false\n'
' size: Size(25.0, 33.0)\n'
' decoration: BoxDecoration:\n'
' color: Color(0xffffff00)\n'
' image: null\n'
' border: null\n'
' borderRadius: null\n'
' boxShadow: null\n'
' gradient: null\n'
' shape: rectangle\n'
' configuration: ImageConfiguration(bundle:\n'
' PlatformAssetBundle#00000(), devicePixelRatio: 1.0, platform:\n'
' android)\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'
......
......@@ -190,7 +190,7 @@ void main() {
),
);
// The important lines below are the ones marked with "<----"
expect(tester.binding.renderView.toStringDeep(), equalsIgnoringHashCodes(
expect(tester.binding.renderView.toStringDeep(minLevel: DiagnosticLevel.info), equalsIgnoringHashCodes(
'RenderView#00000\n'
' │ debug mode enabled - ${Platform.operatingSystem}\n'
' │ window size: Size(2400.0, 1800.0) (in physical pixels)\n'
......@@ -198,10 +198,6 @@ void main() {
' │ configuration: Size(800.0, 600.0) at 3.0x (in logical pixels)\n'
' │\n'
' └─child: RenderRepaintBoundary#00000\n'
' │ creator: RepaintBoundary ←\n'
' │ NotificationListener<ScrollNotification> ←\n'
' │ GlowingOverscrollIndicator ← Scrollable ← ListView ←\n'
' │ Directionality ← [root]\n'
' │ parentData: <none>\n'
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ layer: OffsetLayer#00000\n'
......@@ -211,19 +207,11 @@ void main() {
' │ repaints)\n'
' │\n'
' └─child: RenderCustomPaint#00000\n'
' │ creator: CustomPaint ← RepaintBoundary ←\n'
' │ NotificationListener<ScrollNotification> ←\n'
' │ GlowingOverscrollIndicator ← Scrollable ← ListView ←\n'
' │ Directionality ← [root]\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ size: Size(800.0, 600.0)\n'
' │\n'
' └─child: RenderRepaintBoundary#00000\n'
' │ creator: RepaintBoundary ← CustomPaint ← RepaintBoundary ←\n'
' │ NotificationListener<ScrollNotification> ←\n'
' │ GlowingOverscrollIndicator ← Scrollable ← ListView ←\n'
' │ Directionality ← [root]\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ layer: OffsetLayer#00000\n'
......@@ -233,12 +221,6 @@ void main() {
' │ repaints)\n'
' │\n'
' └─child: RenderSemanticsGestureHandler#00000\n'
' │ creator: _GestureSemantics ←\n'
' │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ ← RepaintBoundary ← CustomPaint ← RepaintBoundary ←\n'
' │ NotificationListener<ScrollNotification> ←\n'
' │ GlowingOverscrollIndicator ← Scrollable ← ListView ←\n'
' │ Directionality ← [root]\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ semantic boundary\n'
......@@ -246,12 +228,6 @@ void main() {
' │ gestures: vertical scroll\n'
' │\n'
' └─child: RenderPointerListener#00000\n'
' │ creator: Listener ← _GestureSemantics ←\n'
' │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ ← RepaintBoundary ← CustomPaint ← RepaintBoundary ←\n'
' │ NotificationListener<ScrollNotification> ←\n'
' │ GlowingOverscrollIndicator ← Scrollable ← ListView ←\n'
' │ Directionality ← [root]\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ size: Size(800.0, 600.0)\n'
......@@ -259,13 +235,6 @@ void main() {
' │ listeners: down\n'
' │\n'
' └─child: RenderIgnorePointer#00000\n'
' │ creator: IgnorePointer-[GlobalKey#00000] ← Listener ←\n'
' │ _GestureSemantics ←\n'
' │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ ← RepaintBoundary ← CustomPaint ← RepaintBoundary ←\n'
' │ NotificationListener<ScrollNotification> ←\n'
' │ GlowingOverscrollIndicator ← Scrollable ← ListView ←\n'
' │ Directionality ← ⋯\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ size: Size(800.0, 600.0)\n'
......@@ -273,13 +242,6 @@ void main() {
' │ ignoringSemantics: implicitly false\n'
' │\n'
' └─child: RenderViewport#00000\n'
' │ creator: Viewport ← _ScrollableScope ←\n'
' │ IgnorePointer-[GlobalKey#00000] ← Listener ← _GestureSemantics\n'
' │ ←\n'
' │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ ← RepaintBoundary ← CustomPaint ← RepaintBoundary ←\n'
' │ NotificationListener<ScrollNotification> ←\n'
' │ GlowingOverscrollIndicator ← Scrollable ← ⋯\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ layer: OffsetLayer#00000\n'
......@@ -293,13 +255,6 @@ void main() {
' │ anchor: 0.0\n'
' │\n'
' └─center child: RenderSliverFixedExtentList#00000 relayoutBoundary=up1\n'
' │ creator: SliverFixedExtentList ← 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'
......@@ -311,13 +266,6 @@ void main() {
' │ currently live children: 0 to 1\n'
' │\n'
' ├─child with index 0: RenderLimitedBox#00000\n'
' │ │ creator: LimitedBox ← Placeholder ← KeepAlive ←\n'
' │ │ Leaf-[GlobalObjectKey<_LeafState> int#00000] ←\n'
' │ │ SliverFixedExtentList ← Viewport ← _ScrollableScope ←\n'
' │ │ IgnorePointer-[GlobalKey#00000] ← Listener ← _GestureSemantics\n'
' │ │ ←\n'
' │ │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ │ ← RepaintBoundary ← ⋯\n'
' │ │ parentData: index=0; layoutOffset=0.0\n'
' │ │ constraints: BoxConstraints(w=800.0, h=400.0)\n'
' │ │ size: Size(800.0, 400.0)\n'
......@@ -325,25 +273,11 @@ void main() {
' │ │ maxHeight: 400.0\n'
' │ │\n'
' │ └─child: RenderCustomPaint#00000\n'
' │ creator: CustomPaint ← LimitedBox ← Placeholder ← KeepAlive ←\n'
' │ Leaf-[GlobalObjectKey<_LeafState> int#00000] ←\n'
' │ SliverFixedExtentList ← Viewport ← _ScrollableScope ←\n'
' │ IgnorePointer-[GlobalKey#00000] ← Listener ← _GestureSemantics\n'
' │ ←\n'
' │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ ← ⋯\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=800.0, h=400.0)\n'
' │ size: Size(800.0, 400.0)\n'
' │\n'
' └─child with index 1: RenderLimitedBox#00000\n' // <----- no dashed line starts here
' │ creator: LimitedBox ← Placeholder ← KeepAlive ←\n'
' │ Leaf-[GlobalObjectKey<_LeafState> int#00000] ←\n'
' │ SliverFixedExtentList ← Viewport ← _ScrollableScope ←\n'
' │ IgnorePointer-[GlobalKey#00000] ← Listener ← _GestureSemantics\n'
' │ ←\n'
' │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ ← RepaintBoundary ← ⋯\n'
' │ parentData: index=1; layoutOffset=400.0\n'
' │ constraints: BoxConstraints(w=800.0, h=400.0)\n'
' │ size: Size(800.0, 400.0)\n'
......@@ -351,13 +285,6 @@ void main() {
' │ maxHeight: 400.0\n'
' │\n'
' └─child: RenderCustomPaint#00000\n'
' creator: CustomPaint ← LimitedBox ← Placeholder ← KeepAlive ←\n'
' Leaf-[GlobalObjectKey<_LeafState> int#00000] ←\n'
' SliverFixedExtentList ← Viewport ← _ScrollableScope ←\n'
' IgnorePointer-[GlobalKey#00000] ← Listener ← _GestureSemantics\n'
' ←\n'
' RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' ← ⋯\n'
' parentData: <none> (can use size)\n'
' constraints: BoxConstraints(w=800.0, h=400.0)\n'
' size: Size(800.0, 400.0)\n'
......@@ -368,7 +295,7 @@ void main() {
const GlobalObjectKey<_LeafState>(3).currentState.setKeepAlive(true);
await tester.drag(find.byType(ListView), const Offset(0.0, -1000.0));
await tester.pump();
expect(tester.binding.renderView.toStringDeep(), equalsIgnoringHashCodes(
expect(tester.binding.renderView.toStringDeep(minLevel: DiagnosticLevel.info), equalsIgnoringHashCodes(
'RenderView#00000\n'
' │ debug mode enabled - ${Platform.operatingSystem}\n'
' │ window size: Size(2400.0, 1800.0) (in physical pixels)\n'
......@@ -376,10 +303,6 @@ void main() {
' │ configuration: Size(800.0, 600.0) at 3.0x (in logical pixels)\n'
' │\n'
' └─child: RenderRepaintBoundary#00000\n'
' │ creator: RepaintBoundary ←\n'
' │ NotificationListener<ScrollNotification> ←\n'
' │ GlowingOverscrollIndicator ← Scrollable ← ListView ←\n'
' │ Directionality ← [root]\n'
' │ parentData: <none>\n'
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ layer: OffsetLayer#00000\n'
......@@ -389,19 +312,11 @@ void main() {
' │ repaints)\n'
' │\n'
' └─child: RenderCustomPaint#00000\n'
' │ creator: CustomPaint ← RepaintBoundary ←\n'
' │ NotificationListener<ScrollNotification> ←\n'
' │ GlowingOverscrollIndicator ← Scrollable ← ListView ←\n'
' │ Directionality ← [root]\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ size: Size(800.0, 600.0)\n'
' │\n'
' └─child: RenderRepaintBoundary#00000\n'
' │ creator: RepaintBoundary ← CustomPaint ← RepaintBoundary ←\n'
' │ NotificationListener<ScrollNotification> ←\n'
' │ GlowingOverscrollIndicator ← Scrollable ← ListView ←\n'
' │ Directionality ← [root]\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ layer: OffsetLayer#00000\n'
......@@ -411,12 +326,6 @@ void main() {
' │ repaints)\n'
' │\n'
' └─child: RenderSemanticsGestureHandler#00000\n'
' │ creator: _GestureSemantics ←\n'
' │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ ← RepaintBoundary ← CustomPaint ← RepaintBoundary ←\n'
' │ NotificationListener<ScrollNotification> ←\n'
' │ GlowingOverscrollIndicator ← Scrollable ← ListView ←\n'
' │ Directionality ← [root]\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ semantic boundary\n'
......@@ -424,12 +333,6 @@ void main() {
' │ gestures: vertical scroll\n'
' │\n'
' └─child: RenderPointerListener#00000\n'
' │ creator: Listener ← _GestureSemantics ←\n'
' │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ ← RepaintBoundary ← CustomPaint ← RepaintBoundary ←\n'
' │ NotificationListener<ScrollNotification> ←\n'
' │ GlowingOverscrollIndicator ← Scrollable ← ListView ←\n'
' │ Directionality ← [root]\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ size: Size(800.0, 600.0)\n'
......@@ -437,13 +340,6 @@ void main() {
' │ listeners: down\n'
' │\n'
' └─child: RenderIgnorePointer#00000\n'
' │ creator: IgnorePointer-[GlobalKey#00000] ← Listener ←\n'
' │ _GestureSemantics ←\n'
' │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ ← RepaintBoundary ← CustomPaint ← RepaintBoundary ←\n'
' │ NotificationListener<ScrollNotification> ←\n'
' │ GlowingOverscrollIndicator ← Scrollable ← ListView ←\n'
' │ Directionality ← ⋯\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ size: Size(800.0, 600.0)\n'
......@@ -451,13 +347,6 @@ void main() {
' │ ignoringSemantics: implicitly false\n'
' │\n'
' └─child: RenderViewport#00000\n'
' │ creator: Viewport ← _ScrollableScope ←\n'
' │ IgnorePointer-[GlobalKey#00000] ← Listener ← _GestureSemantics\n'
' │ ←\n'
' │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ ← RepaintBoundary ← CustomPaint ← RepaintBoundary ←\n'
' │ NotificationListener<ScrollNotification> ←\n'
' │ GlowingOverscrollIndicator ← Scrollable ← ⋯\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ layer: OffsetLayer#00000\n'
......@@ -471,13 +360,6 @@ void main() {
' │ anchor: 0.0\n'
' │\n'
' └─center child: RenderSliverFixedExtentList#00000 relayoutBoundary=up1\n'
' │ creator: SliverFixedExtentList ← 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'
......@@ -489,13 +371,6 @@ void main() {
' │ currently live children: 5 to 6\n'
' │\n'
' ├─child with index 5: RenderLimitedBox#00000\n' // <----- this is index 5, not 0
' │ │ creator: LimitedBox ← Placeholder ← KeepAlive ←\n'
' │ │ Leaf-[GlobalObjectKey<_LeafState> int#00000] ←\n'
' │ │ SliverFixedExtentList ← Viewport ← _ScrollableScope ←\n'
' │ │ IgnorePointer-[GlobalKey#00000] ← Listener ← _GestureSemantics\n'
' │ │ ←\n'
' │ │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ │ ← RepaintBoundary ← ⋯\n'
' │ │ parentData: index=5; layoutOffset=2000.0\n'
' │ │ constraints: BoxConstraints(w=800.0, h=400.0)\n'
' │ │ size: Size(800.0, 400.0)\n'
......@@ -503,25 +378,11 @@ void main() {
' │ │ maxHeight: 400.0\n'
' │ │\n'
' │ └─child: RenderCustomPaint#00000\n'
' │ creator: CustomPaint ← LimitedBox ← Placeholder ← KeepAlive ←\n'
' │ Leaf-[GlobalObjectKey<_LeafState> int#00000] ←\n'
' │ SliverFixedExtentList ← Viewport ← _ScrollableScope ←\n'
' │ IgnorePointer-[GlobalKey#00000] ← Listener ← _GestureSemantics\n'
' │ ←\n'
' │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ ← ⋯\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=800.0, h=400.0)\n'
' │ size: Size(800.0, 400.0)\n'
' │\n'
' ├─child with index 6: RenderLimitedBox#00000\n'
' ╎ │ creator: LimitedBox ← Placeholder ← KeepAlive ←\n' // <----- the line starts becoming dashed here
' ╎ │ Leaf-[GlobalObjectKey<_LeafState> int#00000] ←\n'
' ╎ │ SliverFixedExtentList ← Viewport ← _ScrollableScope ←\n'
' ╎ │ IgnorePointer-[GlobalKey#00000] ← Listener ← _GestureSemantics\n'
' ╎ │ ←\n'
' ╎ │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' ╎ │ ← RepaintBoundary ← ⋯\n'
' ╎ │ parentData: index=6; layoutOffset=2400.0\n'
' ╎ │ constraints: BoxConstraints(w=800.0, h=400.0)\n'
' ╎ │ size: Size(800.0, 400.0)\n'
......@@ -529,25 +390,11 @@ void main() {
' ╎ │ maxHeight: 400.0\n'
' ╎ │\n'
' ╎ └─child: RenderCustomPaint#00000\n'
' ╎ creator: CustomPaint ← LimitedBox ← Placeholder ← KeepAlive ←\n'
' ╎ Leaf-[GlobalObjectKey<_LeafState> int#00000] ←\n'
' ╎ SliverFixedExtentList ← Viewport ← _ScrollableScope ←\n'
' ╎ IgnorePointer-[GlobalKey#00000] ← Listener ← _GestureSemantics\n'
' ╎ ←\n'
' ╎ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' ╎ ← ⋯\n'
' ╎ parentData: <none> (can use size)\n'
' ╎ constraints: BoxConstraints(w=800.0, h=400.0)\n'
' ╎ size: Size(800.0, 400.0)\n'
' ╎\n'
' ╎╌child with index 0 (kept alive offstage): RenderLimitedBox#00000\n' // <----- this one is index 0 and is marked as being offstage
' ╎ │ creator: LimitedBox ← Placeholder ← KeepAlive ←\n'
' ╎ │ Leaf-[GlobalObjectKey<_LeafState> int#00000] ←\n'
' ╎ │ SliverFixedExtentList ← Viewport ← _ScrollableScope ←\n'
' ╎ │ IgnorePointer-[GlobalKey#00000] ← Listener ← _GestureSemantics\n'
' ╎ │ ←\n'
' ╎ │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' ╎ │ ← RepaintBoundary ← ⋯\n'
' ╎ │ parentData: index=0; keepAlive; layoutOffset=0.0\n'
' ╎ │ constraints: BoxConstraints(w=800.0, h=400.0)\n'
' ╎ │ size: Size(800.0, 400.0)\n'
......@@ -555,25 +402,11 @@ void main() {
' ╎ │ maxHeight: 400.0\n'
' ╎ │\n'
' ╎ └─child: RenderCustomPaint#00000\n'
' ╎ creator: CustomPaint ← LimitedBox ← Placeholder ← KeepAlive ←\n'
' ╎ Leaf-[GlobalObjectKey<_LeafState> int#00000] ←\n'
' ╎ SliverFixedExtentList ← Viewport ← _ScrollableScope ←\n'
' ╎ IgnorePointer-[GlobalKey#00000] ← Listener ← _GestureSemantics\n'
' ╎ ←\n'
' ╎ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' ╎ ← ⋯\n'
' ╎ parentData: <none> (can use size)\n'
' ╎ constraints: BoxConstraints(w=800.0, h=400.0)\n'
' ╎ size: Size(800.0, 400.0)\n'
' ╎\n' // <----- dashed line ends here
' └╌child with index 3 (kept alive offstage): RenderLimitedBox#00000\n'
' │ creator: LimitedBox ← Placeholder ← KeepAlive ←\n'
' │ Leaf-[GlobalObjectKey<_LeafState> int#00000] ←\n'
' │ SliverFixedExtentList ← Viewport ← _ScrollableScope ←\n'
' │ IgnorePointer-[GlobalKey#00000] ← Listener ← _GestureSemantics\n'
' │ ←\n'
' │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ ← RepaintBoundary ← ⋯\n'
' │ parentData: index=3; keepAlive; layoutOffset=1200.0\n'
' │ constraints: BoxConstraints(w=800.0, h=400.0)\n'
' │ size: Size(800.0, 400.0)\n'
......@@ -581,17 +414,9 @@ void main() {
' │ maxHeight: 400.0\n'
' │\n'
' └─child: RenderCustomPaint#00000\n'
' creator: CustomPaint ← LimitedBox ← Placeholder ← KeepAlive ←\n'
' Leaf-[GlobalObjectKey<_LeafState> int#00000] ←\n'
' SliverFixedExtentList ← Viewport ← _ScrollableScope ←\n'
' IgnorePointer-[GlobalKey#00000] ← Listener ← _GestureSemantics\n'
' ←\n'
' RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' ← ⋯\n'
' parentData: <none> (can use size)\n'
' constraints: BoxConstraints(w=800.0, h=400.0)\n'
' size: Size(800.0, 400.0)\n'
'' // TODO(ianh): remove blank line
));
});
......
......@@ -300,16 +300,9 @@ void main() {
expect(list, hasAGoodToStringDeep);
expect(
list.toStringDeep(),
list.toStringDeep(minLevel: DiagnosticLevel.info),
equalsIgnoringHashCodes(
'RenderSliverList#00000 relayoutBoundary=up1\n'
' │ creator: SliverList ← 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'
......@@ -321,12 +314,6 @@ void main() {
' │ currently live children: 0 to 2\n'
' │\n'
' ├─child with index 0: RenderRepaintBoundary#00000 relayoutBoundary=up2\n'
' │ │ creator: RepaintBoundary-[<0>] ← SliverList ← 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 (can use size)\n'
' │ │ constraints: BoxConstraints(w=800.0, 0.0<=h<=Infinity)\n'
' │ │ layer: OffsetLayer#00000\n'
......@@ -336,24 +323,12 @@ void main() {
' │ │ repaints)\n'
' │ │\n'
' │ └─child: RenderConstrainedBox#00000 relayoutBoundary=up3\n'
' │ │ creator: ConstrainedBox ← Container ← RepaintBoundary-[<0>] ←\n'
' │ │ SliverList ← Viewport ← _ScrollableScope ←\n'
' │ │ IgnorePointer-[GlobalKey#00000] ← Listener ← _GestureSemantics\n'
' │ │ ←\n'
' │ │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ │ ← RepaintBoundary ← CustomPaint ← ⋯\n'
' │ │ parentData: <none> (can use size)\n'
' │ │ constraints: BoxConstraints(w=800.0, 0.0<=h<=Infinity)\n'
' │ │ size: Size(800.0, 100.0)\n'
' │ │ additionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=100.0)\n'
' │ │\n'
' │ └─child: RenderLimitedBox#00000\n'
' │ │ creator: LimitedBox ← ConstrainedBox ← Container ←\n'
' │ │ RepaintBoundary-[<0>] ← SliverList ← 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, h=100.0)\n'
' │ │ size: Size(800.0, 100.0)\n'
......@@ -361,24 +336,12 @@ void main() {
' │ │ maxHeight: 0.0\n'
' │ │\n'
' │ └─child: RenderConstrainedBox#00000\n'
' │ creator: ConstrainedBox ← LimitedBox ← ConstrainedBox ← Container\n'
' │ ← RepaintBoundary-[<0>] ← SliverList ← 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, h=100.0)\n'
' │ size: Size(800.0, 100.0)\n'
' │ additionalConstraints: BoxConstraints(biggest)\n'
' │\n'
' ├─child with index 1: RenderRepaintBoundary#00000 relayoutBoundary=up2\n'
' │ │ creator: RepaintBoundary-[<1>] ← SliverList ← Viewport ←\n'
' │ │ _ScrollableScope ← IgnorePointer-[GlobalKey#00000] ← Listener ←\n'
' │ │ _GestureSemantics ←\n'
' │ │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ │ ← RepaintBoundary ← CustomPaint ← RepaintBoundary ←\n'
' │ │ NotificationListener<ScrollNotification> ← ⋯\n'
' │ │ parentData: index=1; layoutOffset=100.0 (can use size)\n'
' │ │ constraints: BoxConstraints(w=800.0, 0.0<=h<=Infinity)\n'
' │ │ layer: OffsetLayer#00000\n'
......@@ -388,24 +351,12 @@ void main() {
' │ │ repaints)\n'
' │ │\n'
' │ └─child: RenderConstrainedBox#00000 relayoutBoundary=up3\n'
' │ │ creator: ConstrainedBox ← Container ← RepaintBoundary-[<1>] ←\n'
' │ │ SliverList ← Viewport ← _ScrollableScope ←\n'
' │ │ IgnorePointer-[GlobalKey#00000] ← Listener ← _GestureSemantics\n'
' │ │ ←\n'
' │ │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ │ ← RepaintBoundary ← CustomPaint ← ⋯\n'
' │ │ parentData: <none> (can use size)\n'
' │ │ constraints: BoxConstraints(w=800.0, 0.0<=h<=Infinity)\n'
' │ │ size: Size(800.0, 100.0)\n'
' │ │ additionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=100.0)\n'
' │ │\n'
' │ └─child: RenderLimitedBox#00000\n'
' │ │ creator: LimitedBox ← ConstrainedBox ← Container ←\n'
' │ │ RepaintBoundary-[<1>] ← SliverList ← 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, h=100.0)\n'
' │ │ size: Size(800.0, 100.0)\n'
......@@ -413,24 +364,12 @@ void main() {
' │ │ maxHeight: 0.0\n'
' │ │\n'
' │ └─child: RenderConstrainedBox#00000\n'
' │ creator: ConstrainedBox ← LimitedBox ← ConstrainedBox ← Container\n'
' │ ← RepaintBoundary-[<1>] ← SliverList ← 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, h=100.0)\n'
' │ size: Size(800.0, 100.0)\n'
' │ additionalConstraints: BoxConstraints(biggest)\n'
' │\n'
' └─child with index 2: RenderRepaintBoundary#00000 relayoutBoundary=up2\n'
' │ creator: RepaintBoundary-[<2>] ← SliverList ← Viewport ←\n'
' │ _ScrollableScope ← IgnorePointer-[GlobalKey#00000] ← Listener ←\n'
' │ _GestureSemantics ←\n'
' │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ ← RepaintBoundary ← CustomPaint ← RepaintBoundary ←\n'
' │ NotificationListener<ScrollNotification> ← ⋯\n'
' │ parentData: index=2; layoutOffset=200.0 (can use size)\n'
' │ constraints: BoxConstraints(w=800.0, 0.0<=h<=Infinity)\n'
' │ layer: OffsetLayer#00000\n'
......@@ -440,24 +379,12 @@ void main() {
' │ repaints)\n'
' │\n'
' └─child: RenderConstrainedBox#00000 relayoutBoundary=up3\n'
' │ creator: ConstrainedBox ← Container ← RepaintBoundary-[<2>] ←\n'
' │ SliverList ← Viewport ← _ScrollableScope ←\n'
' │ IgnorePointer-[GlobalKey#00000] ← Listener ← _GestureSemantics\n'
' │ ←\n'
' │ RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#00000]\n'
' │ ← RepaintBoundary ← CustomPaint ← ⋯\n'
' │ parentData: <none> (can use size)\n'
' │ constraints: BoxConstraints(w=800.0, 0.0<=h<=Infinity)\n'
' │ size: Size(800.0, 100.0)\n'
' │ additionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=100.0)\n'
' │\n'
' └─child: RenderLimitedBox#00000\n'
' │ creator: LimitedBox ← ConstrainedBox ← Container ←\n'
' │ RepaintBoundary-[<2>] ← SliverList ← 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, h=100.0)\n'
' │ size: Size(800.0, 100.0)\n'
......@@ -465,12 +392,6 @@ void main() {
' │ maxHeight: 0.0\n'
' │\n'
' └─child: RenderConstrainedBox#00000\n'
' creator: ConstrainedBox ← LimitedBox ← ConstrainedBox ← Container\n'
' ← RepaintBoundary-[<2>] ← SliverList ← 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, h=100.0)\n'
' size: Size(800.0, 100.0)\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,50 +34,38 @@ 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'
' │ 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'
' ╎ │ parentData: not positioned; offset=Offset(0.0, 0.0) (can use\n'
' ╎ │ size)\n'
' ╎ │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' ╎ │ size: Size(800.0, 600.0)\n'
' ╎ │ alignment: FractionalOffsetDirectional.topStart\n'
' ╎ │ textDirection: ltr\n'
' ╎ │ 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'
' ╎ │ parentData: not positioned; offset=Offset(0.0, 0.0) (can use\n'
' ╎ │ size)\n'
' ╎ │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' ╎ │ size: Size(800.0, 600.0)\n'
' ╎ │ 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'
' ╎ 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'
' └╌no offstage children\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#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'
' ╎ │ size: Size(800.0, 600.0)\n'
' ╎ │ alignment: FractionalOffsetDirectional.topStart\n'
' ╎ │ textDirection: ltr\n'
' ╎ │ fit: expand\n'
' ╎ │ overflow: clip\n'
' ╎ │\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'
' ╎ │ size: Size(800.0, 600.0)\n'
' ╎ │ maxWidth: 0.0\n'
' ╎ │ maxHeight: 0.0\n'
' ╎ │\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'
' ╎ additionalConstraints: BoxConstraints(biggest)\n'
' ╎\n'
' └╌no offstage children\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