ErrorHint class Null safety

An ErrorHint provides specific, non-obvious advice that may be applicable.

If your message provides obvious advice that is always applicable, it is an ErrorDescription not a hint.

In debug builds, values interpolated into the message are expanded and placed into value, which is of type List<Object>. This allows IDEs to examine values interpolated into error messages.

See also:

  • ErrorSummary, which provides a short (one line) description of the problem that was detected.
  • ErrorDescription, which provides an explanation of the problem and its cause, any information that may help track down the problem, background information, etc.
  • ErrorSpacer, which renders as a blank line.
  • FlutterError, which is the most common place to use an ErrorHint.
Inheritance

Constructors

ErrorHint(String message)
A lint enforces that this constructor can only be called with a string literal to match the limitations of the Dart Kernel transformer that optionally extracts out objects referenced using string interpolation in the message passed in.

Properties

allowNameWrap bool
Whether to wrap the name onto multiple lines or not.
finalinherited
allowTruncate bool
Whether to allow truncation when displaying the node and its children.
read-onlyinherited
allowWrap bool
Whether to wrap text on onto multiple lines or not.
finalinherited
defaultValue Object?
The default value of this property, when it has not been set to a specific value.
finalinherited
emptyBodyDescription String?
Description to show if the node has no displayed properties or children.
read-onlyinherited
exception Object?
Exception thrown if accessing the property value threw an exception.
read-onlyinherited
expandableValue bool
Whether to expose properties and children of the value as properties and children.
finalinherited
hashCode int
The hash code for this object.
read-onlyinherited
ifEmpty String?
Description if the property description would otherwise be empty.
finalinherited
ifNull String?
Description if the property value is null.
finalinherited
isInteresting bool
Whether to consider the property's value interesting. When a property is uninteresting, its level is downgraded to DiagnosticLevel.fine regardless of the value provided as the constructor's level argument.
read-onlyinherited
level DiagnosticLevel
Priority level of the diagnostic used to control which diagnostics should be shown and filtered.
read-onlyinherited
linePrefix String?
Prefix to include at the start of each line.
finalinherited
missingIfNull bool
Whether a value of null causes the property to have level DiagnosticLevel.warning warning that the property is missing a value.
finalinherited
name String?
Label describing the DiagnosticsNode, typically shown before a separator (see showSeparator).
finalinherited
propertyType Type
The type of the property value.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
showName bool
Whether the name of the property should be shown when showing the default view of the tree.
finalinherited
showSeparator bool
Whether to show a separator between name and description.
finalinherited
style DiagnosticsTreeStyle?
Hint for how the node should be displayed.
finalinherited
textTreeConfiguration TextTreeConfiguration?
Returns a configuration specifying how this object should be rendered as text art.
protected">@protectedread-onlyinherited
tooltip String?
Optional tooltip typically describing the property.
finalinherited
value List<Object>
Returns the value of the property either from cache or by invoking a ComputePropertyValueCallback.
read-onlyinherited

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 non-existent 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.
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}) 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.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited