StaticWarningCode class

The error codes used for static warnings. The convention for this class is for the name of the error code to indicate the problem that caused the error to be generated and for the error message to explain what is wrong and, when appropriate, how the problem can be corrected.

Inheritance
Implementers

Constructors

StaticWarningCode(String name, String message, {String correction, bool hasPublishedDocs, bool isUnresolvedIdentifier: false})
Initialize a newly created error code to have the given name. The message associated with the error will be created from the given message template. The correction associated with the error will be created from the given correction template.
const

Properties

correction String
The template used to create the correction to be displayed for this error, or null if there is no correction information for this error. The correction should indicate how the user can fix the error.
read-only, inherited
errorSeverity ErrorSeverity
The severity of the error.
read-only, override
hashCode int
The hash code for this object. [...]
read-only, inherited
hasPublishedDocs bool
Return true if diagnostics with this code have documentation for them that has been published.
final, inherited
isIgnorable bool
Whether a finding of this error is ignorable via comments such as // ignore: or // ignore_for_file:.
read-only, inherited
isUnresolvedIdentifier bool
Whether this error is caused by an unresolved identifier.
final, inherited
message String
The template used to create the message to be displayed for this error. The message should indicate what is wrong and why it is wrong.
read-only, inherited
name String
The name of the error code.
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
type ErrorType
The type of the error.
read-only, override
uniqueName String
The unique name of this error code.
read-only, inherited
url String
Return a URL that can be used to access documentation for diagnostics with this code, or null if there is no published documentation.
read-only, inherited

Methods

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

Operators

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

Constants

DEAD_NULL_AWARE_EXPRESSION → const StaticWarningCode
No parameters.
const StaticWarningCode('DEAD_NULL_AWARE_EXPRESSION', "The left operand can't be null, so the right operand is never executed.", correction: "Try removing the operator and t…
INVALID_NULL_AWARE_OPERATOR → const StaticWarningCode
Parameters: 0: The null-aware operator that is invalid 1: The non-null-aware operator that can replace the invalid operator
const StaticWarningCode('INVALID_NULL_AWARE_OPERATOR', "The receiver can't be null, so the null-aware operator '{0}' can't " "be used.", correction: "T…
INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT → const StaticWarningCode
Parameters: 0: The null-aware operator that is invalid 1: The non-null-aware operator that can replace the invalid operator
const StaticWarningCodeWithUniqueName('INVALID_NULL_AWARE_OPERATOR', 'INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT', "The receiver can't be null because of short-circuiting…
INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED → const StaticWarningCode
7.1 Instance Methods: It is a static warning if an instance method m1 overrides an instance member m2, the signature of m2 explicitly specifies a default value for a formal parameter p and the signature of m1 specifies a different default value for p.
const StaticWarningCode('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED', "Parameters can't override default values, this method overrides " "'{0}.{1}' where '{…
INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL → const StaticWarningCode
7.1 Instance Methods: It is a static warning if an instance method m1 overrides an instance member m2, the signature of m2 explicitly specifies a default value for a formal parameter p and the signature of m1 specifies a different default value for p.
const StaticWarningCode('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL', "Parameters can't override default values, this method overrides " "'{0}.{1}' where t…
MISSING_ENUM_CONSTANT_IN_SWITCH → const StaticWarningCode
Parameters: 0: the name of the constant that is missing
const StaticWarningCode('MISSING_ENUM_CONSTANT_IN_SWITCH', "Missing case clause for '{0}'.", correction: "Try adding a case clause for the missing constant, or " &q…
UNNECESSARY_NON_NULL_ASSERTION → const StaticWarningCode
No parameters.
const StaticWarningCode('UNNECESSARY_NON_NULL_ASSERTION', "The '!' will have no effect because the receiver can't be null.", correction: "Try removing the '!'…