ObjectFlagProperty class - foundation library (original) (raw)

A property where the important diagnostic information is primarily whether the value is present (non-null) or absent (null), rather than the actual value of the property itself.

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 level should beDiagnosticLevel.hidden when value is non-null or null respectively.

This kind of diagnostics property is typically used for opaque values, like closures, where presenting the actual object is of dubious value but where reporting the presence or absence of the value is much more useful.

See also:

Inheritance

Constructors

ObjectFlagProperty(String name, T? value, {String? ifPresent, String? ifNull, bool showName = false, DiagnosticLevel level = DiagnosticLevel.info})

Create a diagnostics property for values that can be present (non-null) or absent (null), but for which the exact value's Object.toStringrepresentation is not very transparent (e.g. a callback).

ObjectFlagProperty.has(String name, T? value, {DiagnosticLevel level = DiagnosticLevel.info})

Shorthand constructor to describe whether the property has a value.

Properties

allowNameWrapbool

Whether to wrap the name onto multiple lines or not.

finalinherited

allowTruncatebool

Whether to allow truncation when displaying the node and its children.

no setterinherited

allowWrapbool

Whether to wrap text on onto multiple lines or not.

finalinherited

defaultValueObject?

The default value of this property, when it has not been set to a specific value.

finalinherited

emptyBodyDescriptionString?

Description to show if the node has no displayed properties or children.

no setterinherited

exceptionObject?

Exception thrown if accessing the property value threw an exception.

no setterinherited

expandableValuebool

Whether to expose properties and children of the value as properties and children.

finalinherited

hashCodeint

The hash code for this object.

no setterinherited

ifEmptyString?

Description if the property description would otherwise be empty.

finalinherited

ifNullString?

Description if the property value is null.

finalinherited

ifPresentString?

Description to use if the property value is not null.

final

isInterestingbool

Whether to consider the property's value interesting. When a property is uninteresting, its level is downgraded to DiagnosticLevel.fineregardless of the value provided as the constructor's level argument.

no setterinherited

levelDiagnosticLevel

Priority level of the diagnostic used to control which diagnostics should be shown and filtered.

no setteroverride

linePrefixString?

Prefix to include at the start of each line.

finalinherited

missingIfNullbool

Whether a value of null causes the property to have level DiagnosticLevel.warning warning that the property is missing a value.

finalinherited

nameString?

Label describing the DiagnosticsNode, typically shown before a separator (see showSeparator).

finalinherited

propertyTypeType

The type of the property value.

no setterinherited

runtimeTypeType

A representation of the runtime type of the object.

no setterinherited

showNamebool

Whether the name of the property should be shown when showing the default view of the tree.

no setteroverride

showSeparatorbool

Whether to show a separator between name and description.

finalinherited

styleDiagnosticsTreeStyle?

Hint for how the node should be displayed.

finalinherited

textTreeConfigurationTextTreeConfiguration?

Returns a configuration specifying how this object should be rendered as text art.

no setterinherited

tooltipString?

Optional tooltip typically describing the property.

finalinherited

value → T?

Returns the value of the property either from cache or by invoking aComputePropertyValueCallback.

no setterinherited

Methods

getChildren()→ List<DiagnosticsNode>

Children of this DiagnosticsNode.

inherited

getProperties()→ List<DiagnosticsNode>

Properties of this DiagnosticsNode.

inherited

isFiltered(DiagnosticLevel minLevel)→ bool

Whether the diagnostic should be filtered due to its level being lower than minLevel.

inherited

noSuchMethod(Invocation invocation)→ dynamic

Invoked when a nonexistent method or property is accessed.

inherited

toDescription({TextTreeConfiguration? parentConfiguration})→ String

Returns a description with a short summary of the node itself not including children or properties.

inherited

toJsonMap(DiagnosticsSerializationDelegate delegate)→ Map<String, Object?>

Serialize the node to a JSON map according to the configuration provided in the DiagnosticsSerializationDelegate.

override

toJsonMapIterative(DiagnosticsSerializationDelegate delegate)→ Map<String, Object?>

Iteratively serialize the node to a JSON map according to the configuration provided in the DiagnosticsSerializationDelegate.

inherited

toString({TextTreeConfiguration? parentConfiguration, DiagnosticLevel minLevel = DiagnosticLevel.info})→ String

Returns a string representation of this diagnostic that is compatible with the style of the parent if the node is not the root.

inherited

toStringDeep({String prefixLineOne = '', String? prefixOtherLines, TextTreeConfiguration? parentConfiguration, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65})→ String

Returns a string representation of this node and its descendants.

inherited

toTimelineArguments()→ Map<String, String>?

Converts the properties (getProperties) of this node to a form useful for Timeline event arguments (as in Timeline.startSync).

inherited

valueToString({TextTreeConfiguration? parentConfiguration})→ String

Returns a string representation of the property value.

override

Operators

operator ==(Object other)→ bool

The equality operator.

inherited