DiagnosticLevel enum

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.


debug → const DiagnosticLevel

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.

const DiagnosticLevel(2)
error → const DiagnosticLevel

Diagnostics that indicate errors or unexpected conditions.

For example, use for property values where computing the value throws an exception.

const DiagnosticLevel(5)
fine → const DiagnosticLevel

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.

const DiagnosticLevel(1)
hidden → const 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.

const DiagnosticLevel(0)
info → const DiagnosticLevel

Interesting diagnostics that should be typically shown.

const DiagnosticLevel(3)
off → const DiagnosticLevel

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.

const DiagnosticLevel(6)
values → const List<DiagnosticLevel>

A constant List of the values in this enum, in order of their declaration.

const List<DiagnosticLevel>
warning → const DiagnosticLevel

Very important diagnostics that indicate problematic property values.

For example, use if you would write the property description message in ALL CAPS.

const DiagnosticLevel(4)


index int

The integer index of this enum.

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


toString() String
Returns a string representation of this object.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]


operator ==(dynamic other) bool
The equality operator. [...]