HintCode class

The hints and coding recommendations for best practices which are not mentioned in the Dart Language Specification.

Inheritance
Implementers

Constructors

HintCode(String name, String message, {String correction, bool hasPublishedDocs})
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

ASSIGNMENT_OF_DO_NOT_STORE → const HintCode
Users should not assign values marked @doNotStore.
HintCode('ASSIGNMENT_OF_DO_NOT_STORE', ''{0}' is marked 'doNotStore' and shouldn't be assigned to a field.', correction: 'Try removing the assignment.')
CAN_BE_NULL_AFTER_NULL_AWARE → const HintCode
When the target expression uses '?.' operator, it can be null, so all the subsequent invocations should also use '?.' operator.
HintCode('CAN_BE_NULL_AFTER_NULL_AWARE', 'The receiver uses '?.', so its value can be null.', correction: 'Replace the '.' with a '?.' in the invocation.…
DEAD_CODE → const HintCode
Dead code is code that is never reached, this can happen for instance if a statement follows a return statement. [...]
HintCode('DEAD_CODE', 'Dead code.', correction: 'Try removing the code, or ' 'fixing the code before it so that it can be reached.', hasPublishedDocs: true)
DEAD_CODE_CATCH_FOLLOWING_CATCH → const HintCode
Dead code is code that is never reached. This case covers cases where the user has catch clauses after catch (e) or on Object catch (e). [...]
HintCode('DEAD_CODE_CATCH_FOLLOWING_CATCH', 'Dead code: Catch clauses after a 'catch (e)' or an ' ''on Object catch (e)' are never reached.', correction: 'T…
DEAD_CODE_ON_CATCH_SUBTYPE → const HintCode
Dead code is code that is never reached. This case covers cases where the user has an on-catch clause such as on A catch (e), where a supertype of A was already caught. [...]
HintCode('DEAD_CODE_ON_CATCH_SUBTYPE', 'Dead code: This on-catch block won’t be executed because '{0}' is a ' 'subtype of '{1}' and hence will have been caught alre…
DEPRECATED_EXTENDS_FUNCTION → const HintCode
Function should not be extended anymore.
HintCode('DEPRECATED_EXTENDS_FUNCTION', 'Extending 'Function' is deprecated.', correction: 'Try removing 'Function' from the 'extends' clause.')
DEPRECATED_FUNCTION_CLASS_DECLARATION → const HintCode
Users should not create a class named Function anymore.
HintCode('DEPRECATED_FUNCTION_CLASS_DECLARATION', 'Declaring a class named 'Function' is deprecated.', correction: 'Try renaming the class.')
DEPRECATED_MEMBER_USE → const HintCode
Parameters: 0: the name of the member
HintCode('DEPRECATED_MEMBER_USE', ''{0}' is deprecated and shouldn't be used.', correction: 'Try replacing the use of the deprecated member with the ' 'replacem…
DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE → const HintCode
Parameters: 0: the name of the member
HintCode('DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE', ''{0}' is deprecated and shouldn't be used.', correction: 'Try replacing the use of the deprecated member with the &…
DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE_WITH_MESSAGE → const HintCode
Parameters: 0: the name of the member 1: message details
HintCodeWithUniqueName('DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE', 'HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE_WITH_MESSAGE', ''{0}' is deprecated and shouldn't be…
DEPRECATED_MEMBER_USE_WITH_MESSAGE → const HintCode
Parameters: 0: the name of the member 1: message details
HintCodeWithUniqueName('DEPRECATED_MEMBER_USE', 'HintCode.DEPRECATED_MEMBER_USE_WITH_MESSAGE', ''{0}' is deprecated and shouldn't be used. {1}.', correction: 'T…
DEPRECATED_MIXIN_FUNCTION → const HintCode
Function should not be mixed in anymore.
HintCode('DEPRECATED_MIXIN_FUNCTION', 'Mixing in 'Function' is deprecated.', correction: 'Try removing 'Function' from the 'with' clause.')
DIVISION_OPTIMIZATION → const HintCode
Hint to use the ~/ operator.
HintCode('DIVISION_OPTIMIZATION', 'The operator x ~/ y is more efficient than (x / y).toInt().', correction: 'Try re-writing the expression to use the '~/' oper…
DUPLICATE_HIDDEN_NAME → const HintCode
Duplicate hidden names.
HintCode('DUPLICATE_HIDDEN_NAME', 'Duplicate hidden name.', correction: 'Try removing the repeated name from the list of hidden ' 'members.')
DUPLICATE_IMPORT → const HintCode
Duplicate imports. [...]
HintCode('DUPLICATE_IMPORT', 'Duplicate import.', correction: 'Try removing all but one import of the library.', hasPublishedDocs: true)
DUPLICATE_SHOWN_NAME → const HintCode
Duplicate shown names.
HintCode('DUPLICATE_SHOWN_NAME', 'Duplicate shown name.', correction: 'Try removing the repeated name from the list of shown ' 'members.')
EQUAL_ELEMENTS_IN_SET → const HintCode
No parameters.
HintCode('EQUAL_ELEMENTS_IN_SET', 'Two elements in a set literal shouldn't be equal.', correction: 'Change or remove the duplicate element.', hasPublishedDocs: true)
EQUAL_KEYS_IN_MAP → const HintCode
No parameters.
HintCode('EQUAL_KEYS_IN_MAP', 'Two keys in a map literal shouldn't be equal.', correction: 'Change or remove the duplicate key.', hasPublishedDocs: true)
FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE → const HintCode
It is a bad practice for a source file in a package "lib" directory hierarchy to traverse outside that directory hierarchy. For example, a source file in the "lib" directory should not contain a directive such as import '../web/some.dart' which references a file outside the lib directory.
HintCode('FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE', 'A file in the 'lib' directory shouldn't import a file outside the ' ''lib' directory.', correcti…
FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE → const HintCode
It is a bad practice for a source file ouside a package "lib" directory hierarchy to traverse into that directory hierarchy. For example, a source file in the "web" directory should not contain a directive such as import '../lib/some.dart' which references a file inside the lib directory.
HintCode('FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE', 'A file outside the 'lib' directory shouldn't reference a file ' 'inside the 'lib' directory using a …
IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION → const HintCode
Deferred libraries shouldn't define a top level function 'loadLibrary'.
HintCode('IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION', 'The library '{0}' defines a top-level function named 'loadLibrary' ' 'which is hidden by deferring this libr…
INFERENCE_FAILURE_ON_COLLECTION_LITERAL → const HintCode
When "strict-inference" is enabled, collection literal types must be inferred via the context type, or have type arguments.
HintCode('INFERENCE_FAILURE_ON_COLLECTION_LITERAL', 'The type argument(s) of '{0}' can't be inferred.', correction: 'Use explicit type argument(s) for '{0}'.…
INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE → const HintCode
When "strict-inference" is enabled, recursive local functions, top-level functions, methods, and function-typed function parameters must all specify a return type. See the strict-inference resource: [...]
HintCode('INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE', 'The return type of '{0}' cannot be inferred.', correction: 'Declare the return type of '{0}'.')
INFERENCE_FAILURE_ON_INSTANCE_CREATION → const HintCode
When "strict-inference" is enabled, types in instance creation (constructor calls) must be inferred via the context type, or have type arguments.
HintCode('INFERENCE_FAILURE_ON_INSTANCE_CREATION', 'The type argument(s) of the constructor '{0}' can't be inferred.', correction: 'Use explicit type argument(s) for &#…
INFERENCE_FAILURE_ON_UNINITIALIZED_VARIABLE → const HintCode
When "strict-inference" in enabled, uninitialized variables must be declared with a specific type.
HintCode('INFERENCE_FAILURE_ON_UNINITIALIZED_VARIABLE', 'The type of {0} can't be inferred without either a type or ' 'initializer.', correction: 'Try specifying the ty…
INFERENCE_FAILURE_ON_UNTYPED_PARAMETER → const HintCode
When "strict-inference" in enabled, function parameters must be declared with a specific type, or inherit a type.
HintCode('INFERENCE_FAILURE_ON_UNTYPED_PARAMETER', 'The type of {0} can't be inferred; a type must be explicitly provided.', correction: 'Try specifying the type of the paramet…
INVALID_ANNOTATION_TARGET → const HintCode
Parameters: 0: the name of the annotation 1: the list of valid targets
HintCode('INVALID_ANNOTATION_TARGET', 'The annotation '{0}' can only be used on {1}')
INVALID_FACTORY_ANNOTATION → const HintCode
This hint is generated anywhere a @factory annotation is associated with anything other than a method.
HintCode('INVALID_FACTORY_ANNOTATION', 'Only methods can be annotated as factories.')
INVALID_FACTORY_METHOD_DECL → const HintCode
This hint is generated anywhere a @factory annotation is associated with a method that does not declare a return type.
HintCode('INVALID_FACTORY_METHOD_DECL', 'Factory method '{0}' must have a return type.')
INVALID_FACTORY_METHOD_IMPL → const HintCode
This hint is generated anywhere a @factory annotation is associated with a non-abstract method that can return anything other than a newly allocated object. [...]
HintCode('INVALID_FACTORY_METHOD_IMPL', 'Factory method '{0}' doesn't return a newly allocated object.')
INVALID_IMMUTABLE_ANNOTATION → const HintCode
This hint is generated anywhere an @immutable annotation is associated with anything other than a class.
HintCode('INVALID_IMMUTABLE_ANNOTATION', 'Only classes can be annotated as being immutable.')
INVALID_LANGUAGE_VERSION_OVERRIDE_AT_SIGN → const HintCode
Invalid Dart language version comments don't follow the specification 1. If a comment begins with "@dart" or "dart" (letters in any case), followed by optional whitespace, followed by optional non-alphanumeric, non-whitespace characters, followed by optional whitespace, followed by an optional alphabetical character, followed by a digit, then the comment is considered to be an attempt at a language version override comment. If this attempted language version override comment is not a valid language version override comment, it is reported. [...]
HintCodeWithUniqueName('INVALID_LANGUAGE_VERSION_OVERRIDE', 'HintCode.INVALID_LANGUAGE_VERSION_OVERRIDE_AT_SIGN', 'The Dart language version override number must begin with '@d…
INVALID_LANGUAGE_VERSION_OVERRIDE_EQUALS → const HintCode
Invalid Dart language version comments don't follow the specification 1. If a comment begins with "@dart" or "dart" (letters in any case), followed by optional whitespace, followed by optional non-alphanumeric, non-whitespace characters, followed by optional whitespace, followed by an optional alphabetical character, followed by a digit, then the comment is considered to be an attempt at a language version override comment. If this attempted language version override comment is not a valid language version override comment, it is reported. [...]
HintCodeWithUniqueName('INVALID_LANGUAGE_VERSION_OVERRIDE', 'HintCode.INVALID_LANGUAGE_VERSION_OVERRIDE_EQUALS', 'The Dart language version override comment must be specified with …
INVALID_LANGUAGE_VERSION_OVERRIDE_GREATER → const HintCode
HintCodeWithUniqueName('INVALID_LANGUAGE_VERSION_OVERRIDE', 'INVALID_LANGUAGE_VERSION_OVERRIDE_GREATER', 'The language version override can't specify a version greater than the…
INVALID_LANGUAGE_VERSION_OVERRIDE_LOCATION → const HintCode
HintCodeWithUniqueName('INVALID_LANGUAGE_VERSION_OVERRIDE', 'INVALID_LANGUAGE_VERSION_OVERRIDE_LOCATION', 'The language version override must be before any declaration or ' …
INVALID_LANGUAGE_VERSION_OVERRIDE_LOWER_CASE → const HintCode
Invalid Dart language version comments don't follow the specification 1. If a comment begins with "@dart" or "dart" (letters in any case), followed by optional whitespace, followed by optional non-alphanumeric, non-whitespace characters, followed by optional whitespace, followed by an optional alphabetical character, followed by a digit, then the comment is considered to be an attempt at a language version override comment. If this attempted language version override comment is not a valid language version override comment, it is reported. [...]
HintCodeWithUniqueName('INVALID_LANGUAGE_VERSION_OVERRIDE', 'HintCode.INVALID_LANGUAGE_VERSION_OVERRIDE_LOWER_CASE', 'The Dart language version override comment must be specified w…
INVALID_LANGUAGE_VERSION_OVERRIDE_NUMBER → const HintCode
Invalid Dart language version comments don't follow the specification 1. If a comment begins with "@dart" or "dart" (letters in any case), followed by optional whitespace, followed by optional non-alphanumeric, non-whitespace characters, followed by optional whitespace, followed by an optional alphabetical character, followed by a digit, then the comment is considered to be an attempt at a language version override comment. If this attempted language version override comment is not a valid language version override comment, it is reported. [...]
HintCodeWithUniqueName('INVALID_LANGUAGE_VERSION_OVERRIDE', 'HintCode.INVALID_LANGUAGE_VERSION_OVERRIDE_NUMBER', 'The Dart language version override comment must be specified with …
INVALID_LANGUAGE_VERSION_OVERRIDE_PREFIX → const HintCode
Invalid Dart language version comments don't follow the specification 1. If a comment begins with "@dart" or "dart" (letters in any case), followed by optional whitespace, followed by optional non-alphanumeric, non-whitespace characters, followed by optional whitespace, followed by an optional alphabetical character, followed by a digit, then the comment is considered to be an attempt at a language version override comment. If this attempted language version override comment is not a valid language version override comment, it is reported. [...]
HintCodeWithUniqueName('INVALID_LANGUAGE_VERSION_OVERRIDE', 'HintCode.INVALID_LANGUAGE_VERSION_OVERRIDE_PREFIX', 'The Dart language version override number can't be prefixed wi…
INVALID_LANGUAGE_VERSION_OVERRIDE_TRAILING_CHARACTERS → const HintCode
Invalid Dart language version comments don't follow the specification 1. If a comment begins with "@dart" or "dart" (letters in any case), followed by optional whitespace, followed by optional non-alphanumeric, non-whitespace characters, followed by optional whitespace, followed by an optional alphabetical character, followed by a digit, then the comment is considered to be an attempt at a language version override comment. If this attempted language version override comment is not a valid language version override comment, it is reported. [...]
HintCodeWithUniqueName('INVALID_LANGUAGE_VERSION_OVERRIDE', 'HintCode.INVALID_LANGUAGE_VERSION_OVERRIDE_TRAILING_CHARACTERS', 'The Dart language version override comment can't …
INVALID_LANGUAGE_VERSION_OVERRIDE_TWO_SLASHES → const HintCode
Invalid Dart language version comments don't follow the specification 1. If a comment begins with "@dart" or "dart" (letters in any case), followed by optional whitespace, followed by optional non-alphanumeric, non-whitespace characters, followed by optional whitespace, followed by an optional alphabetical character, followed by a digit, then the comment is considered to be an attempt at a language version override comment. If this attempted language version override comment is not a valid language version override comment, it is reported. [...]
HintCodeWithUniqueName('INVALID_LANGUAGE_VERSION_OVERRIDE', 'HintCode.INVALID_LANGUAGE_VERSION_OVERRIDE_TWO_SLASHES', 'The Dart language version override comment must be specified …
INVALID_LITERAL_ANNOTATION → const HintCode
No parameters.
HintCode('INVALID_LITERAL_ANNOTATION', 'Only const constructors can have the `@literal` annotation.', hasPublishedDocs: true)
INVALID_NON_VIRTUAL_ANNOTATION → const HintCode
This hint is generated anywhere where @nonVirtual annotates something other than a non-abstract instance member in a class or mixin. [...]
HintCode('INVALID_NON_VIRTUAL_ANNOTATION', 'The member '{0}' can't be '@nonVirtual' because it isn't a concrete ' 'instance member.', correction: 'T…
INVALID_OVERRIDE_OF_NON_VIRTUAL_MEMBER → const HintCode
This hint is generated anywhere where an instance member annotated with @nonVirtual is overridden in a subclass. [...]
HintCode('INVALID_OVERRIDE_OF_NON_VIRTUAL_MEMBER', 'The member '{0}' is declared non-virtual in '{1}' and can't be ' 'overridden in subclasses.')
INVALID_REQUIRED_NAMED_PARAM → const HintCode
This hint is generated anywhere where @required annotates a named parameter with a default value. [...]
HintCode('INVALID_REQUIRED_NAMED_PARAM', 'The type parameter '{0}' is annotated with @required but only named ' 'parameters without a default value can be annotated with it…
INVALID_REQUIRED_OPTIONAL_POSITIONAL_PARAM → const HintCode
This hint is generated anywhere where @required annotates an optional positional parameter. [...]
HintCode('INVALID_REQUIRED_OPTIONAL_POSITIONAL_PARAM', 'Incorrect use of the annotation @required on the optional ' 'positional parameter '{0}'. Optional positional paramet…
INVALID_REQUIRED_PARAM → const HintCode
This hint is generated anywhere where @required annotates a non named parameter or a named parameter with default value. [...]
HintCode('INVALID_REQUIRED_PARAM', 'The type parameter '{0}' is annotated with @required but only named ' 'parameters without default value can be annotated with it.', …
INVALID_REQUIRED_POSITIONAL_PARAM → const HintCode
This hint is generated anywhere where @required annotates a non optional positional parameter. [...]
HintCode('INVALID_REQUIRED_POSITIONAL_PARAM', 'Redundant use of the annotation @required on the required positional ' 'parameter '{0}'.', correction: 'Remove @requi…
INVALID_SEALED_ANNOTATION → const HintCode
This hint is generated anywhere where @sealed annotates something other than a class. [...]
HintCode('INVALID_SEALED_ANNOTATION', 'The member '{0}' is annotated with '@sealed' but only classes can be ' 'annotated with it.', correction: 'Remove @sea…
INVALID_USE_OF_PROTECTED_MEMBER → const HintCode
This hint is generated anywhere where a member annotated with @protected is used outside an instance member of a subclass. [...]
HintCode('INVALID_USE_OF_PROTECTED_MEMBER', 'The member '{0}' can only be used within instance members of subclasses ' 'of '{1}'.')
INVALID_USE_OF_VISIBLE_FOR_TEMPLATE_MEMBER → const HintCode
This hint is generated anywhere where a member annotated with @visibleForTemplate is used outside of a "template" Dart file. [...]
HintCode('INVALID_USE_OF_VISIBLE_FOR_TEMPLATE_MEMBER', 'The member '{0}' can only be used within '{1}' or a template ' 'library.')
INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER → const HintCode
This hint is generated anywhere where a member annotated with @visibleForTesting is used outside the defining library, or a test. [...]
HintCode('INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER', 'The member '{0}' can only be used within '{1}' or a test.')
INVALID_VISIBILITY_ANNOTATION → const HintCode
This hint is generated anywhere where a private declaration is annotated with @visibleForTemplate or @visibleForTesting. [...]
HintCode('INVALID_VISIBILITY_ANNOTATION', 'The member '{0}' is annotated with '{1}', but this annotation is only ' 'meaningful on declarations of public members.…
MISSING_JS_LIB_ANNOTATION → const HintCode
Generate a hint for an element that is annotated with @JS(...) whose library declaration is not similarly annotated.
HintCode('MISSING_JS_LIB_ANNOTATION', 'The @JS() annotation can only be used if it is also declared on the ' 'library directive.', correction: 'Try adding the annotation to…
MISSING_REQUIRED_PARAM → const HintCode
Generate a hint for a constructor, function or method invocation where a required parameter is missing. [...]
HintCode('MISSING_REQUIRED_PARAM', 'The parameter '{0}' is required.', hasPublishedDocs: true)
MISSING_REQUIRED_PARAM_WITH_DETAILS → const HintCode
Generate a hint for a constructor, function or method invocation where a required parameter is missing. [...]
HintCodeWithUniqueName('MISSING_REQUIRED_PARAM', 'HintCode.MISSING_REQUIRED_PARAM_WITH_DETAILS', 'The parameter '{0}' is required. {1}.', hasPublishedDocs: true)
MISSING_RETURN → const HintCode
Parameters: 0: the name of the declared return type
HintCode('MISSING_RETURN', 'This function has a return type of '{0}', but doesn't end with a ' 'return statement.', correction: 'Try adding a return statement, …
MIXIN_ON_SEALED_CLASS → const HintCode
This hint is generated anywhere where a @sealed class is used as a a superclass constraint of a mixin. [...]
HintCode('MIXIN_ON_SEALED_CLASS', 'The class '{0}' shouldn't be used as a mixin constraint because it is ' 'sealed, and any class mixing in this mixin must have '{0…
MUST_BE_IMMUTABLE → const HintCode
Generate a hint for classes that inherit from classes annotated with @immutable but that are not immutable.
HintCode('MUST_BE_IMMUTABLE', 'This class (or a class that this class inherits from) is marked as ' ''@immutable', but one or more of its instance fields aren't final: …
MUST_CALL_SUPER → const HintCode
Parameters: 0: the name of the class declaring the overridden method
HintCode('MUST_CALL_SUPER', 'This method overrides a method annotated as '@mustCallSuper' in '{0}', ' 'but doesn't invoke the overridden method.', hasPublis…
NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR → const HintCode
Generate a hint for non-const instance creation using a constructor annotated with @literal. [...]
HintCode('NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR', 'This instance creation must be 'const', because the {0} constructor is ' 'marked as '@literal'.', correction:…
NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR_USING_NEW → const HintCode
Generate a hint for non-const instance creation (with the new keyword) using a constructor annotated with @literal. [...]
HintCodeWithUniqueName('NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR', 'HintCode.NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR_USING_NEW', 'This instance creation must be 'const', because…
NULL_AWARE_BEFORE_OPERATOR → const HintCode
When the left operand of a binary expression uses '?.' operator, it can be null.
HintCode('NULL_AWARE_BEFORE_OPERATOR', 'The left operand uses '?.', so its value can be null.')
NULL_AWARE_IN_CONDITION → const HintCode
A condition in a control flow statement could evaluate to null because it uses the null-aware '?.' operator.
HintCode('NULL_AWARE_IN_CONDITION', 'The value of the '?.' operator can be 'null', which isn't appropriate ' 'in a condition.', correction: 'Try replaci…
NULL_AWARE_IN_LOGICAL_OPERATOR → const HintCode
A condition in operands of a logical operator could evaluate to null because it uses the null-aware '?.' operator.
HintCode('NULL_AWARE_IN_LOGICAL_OPERATOR', 'The value of the '?.' operator can be 'null', which isn't appropriate ' 'as an operand of a logical operator.')
NULLABLE_TYPE_IN_CATCH_CLAUSE → const HintCode
No parameters.
HintCode('NULLABLE_TYPE_IN_CATCH_CLAUSE', 'A potentially nullable type can't be used in an 'on' clause because it ' 'isn't valid to throw a nullable expression.'…
OVERRIDE_EQUALS_BUT_NOT_HASH_CODE → const HintCode
Hint for classes that override equals, but not hashCode. [...]
HintCode('OVERRIDE_EQUALS_BUT_NOT_HASH_CODE', 'The class '{0}' overrides 'operator==', but not 'get hashCode'.', correction: 'Try implementing 'hashCode…
OVERRIDE_ON_NON_OVERRIDING_FIELD → const HintCode
A field with the override annotation does not override a getter or setter. [...]
HintCodeWithUniqueName('OVERRIDE_ON_NON_OVERRIDING_MEMBER', 'HintCode.OVERRIDE_ON_NON_OVERRIDING_FIELD', 'The field doesn't override an inherited getter or setter.', correc…
OVERRIDE_ON_NON_OVERRIDING_GETTER → const HintCode
A getter with the override annotation does not override an existing getter. [...]
HintCodeWithUniqueName('OVERRIDE_ON_NON_OVERRIDING_MEMBER', 'HintCode.OVERRIDE_ON_NON_OVERRIDING_GETTER', 'The getter doesn't override an inherited getter.', correction: &#…
OVERRIDE_ON_NON_OVERRIDING_METHOD → const HintCode
A method with the override annotation does not override an existing method. [...]
HintCodeWithUniqueName('OVERRIDE_ON_NON_OVERRIDING_MEMBER', 'HintCode.OVERRIDE_ON_NON_OVERRIDING_METHOD', 'The method doesn't override an inherited method.', correction: &#…
OVERRIDE_ON_NON_OVERRIDING_SETTER → const HintCode
A setter with the override annotation does not override an existing setter. [...]
HintCodeWithUniqueName('OVERRIDE_ON_NON_OVERRIDING_MEMBER', 'HintCode.OVERRIDE_ON_NON_OVERRIDING_SETTER', 'The setter doesn't override an inherited setter.', correction: &#…
PACKAGE_IMPORT_CONTAINS_DOT_DOT → const HintCode
It is a bad practice for a package import to reference anything outside the given package, or more generally, it is bad practice for a package import to contain a "..". For example, a source file should not contain a directive such as import 'package:foo/../some.dart'.
HintCode('PACKAGE_IMPORT_CONTAINS_DOT_DOT', 'A package import shouldn't contain '..'.')
RECEIVER_OF_TYPE_NEVER → const HintCode
It is not an error to call or tear-off a method, setter, or getter, or to read or write a field, on a receiver of static type Never. Implementations that provide feedback about dead or unreachable code are encouraged to indicate that any arguments to the invocation are unreachable. [...]
HintCode('RECEIVER_OF_TYPE_NEVER', 'The receiver is of type 'Never', and will never complete with a value.', correction: 'Try checking for throw expressions or type errors …
SDK_VERSION_AS_EXPRESSION_IN_CONST_CONTEXT → const HintCode
No parameters.
HintCode('SDK_VERSION_AS_EXPRESSION_IN_CONST_CONTEXT', 'The use of an as expression in a constant expression wasn't ' 'supported until version 2.3.2, but this code is required …
SDK_VERSION_ASYNC_EXPORTED_FROM_CORE → const HintCode
No parameters.
HintCode('SDK_VERSION_ASYNC_EXPORTED_FROM_CORE', 'The class '{0}' wasn't exported from 'dart:core' until version 2.1, ' 'but this code is required to be able to…
SDK_VERSION_BOOL_OPERATOR_IN_CONST_CONTEXT → const HintCode
No parameters.
HintCode('SDK_VERSION_BOOL_OPERATOR_IN_CONST_CONTEXT', 'The use of the operator '{0}' for 'bool' operands in a constant context ' 'wasn't supported until versio…
SDK_VERSION_EQ_EQ_OPERATOR_IN_CONST_CONTEXT → const HintCode
No parameters.
HintCode('SDK_VERSION_EQ_EQ_OPERATOR_IN_CONST_CONTEXT', 'Using the operator '==' for non-primitive types wasn't supported ' 'until version 2.3.2, but this code is requi…
SDK_VERSION_EXTENSION_METHODS → const HintCode
No parameters.
HintCode('SDK_VERSION_EXTENSION_METHODS', 'Extension methods weren't supported until version 2.6.0, ' 'but this code is required to be able to run on earlier versions.', co…
SDK_VERSION_GT_GT_GT_OPERATOR → const HintCode
No parameters.
HintCode('SDK_VERSION_GT_GT_GT_OPERATOR', 'The operator '>>>' wasn't supported until version 2.3.2, but this code ' 'is required to be able to run on earlier v…
SDK_VERSION_IS_EXPRESSION_IN_CONST_CONTEXT → const HintCode
No parameters.
HintCode('SDK_VERSION_IS_EXPRESSION_IN_CONST_CONTEXT', 'The use of an is expression in a constant context wasn't supported ' 'until version 2.3.2, but this code is required to …
SDK_VERSION_NEVER → const HintCode
No parameters.
HintCode('SDK_VERSION_NEVER', 'The type Never isn't yet supported.')
SDK_VERSION_SET_LITERAL → const HintCode
No parameters.
HintCode('SDK_VERSION_SET_LITERAL', 'Set literals weren't supported until version 2.2, but this code is ' 'required to be able to run on earlier versions.', correction: …
SDK_VERSION_UI_AS_CODE → const HintCode
No parameters.
HintCode('SDK_VERSION_UI_AS_CODE', 'The for, if, and spread elements weren't supported until version 2.3.0, ' 'but this code is required to be able to run on earlier versions.&…
SDK_VERSION_UI_AS_CODE_IN_CONST_CONTEXT → const HintCode
No parameters.
HintCode('SDK_VERSION_UI_AS_CODE_IN_CONST_CONTEXT', 'The if and spread elements weren't supported in constant expressions ' 'until version 2.5.0, but this code is required to b…
STRICT_RAW_TYPE → const HintCode
When "strict-raw-types" is enabled, raw types must be inferred via the context type, or have type arguments.
HintCode('STRICT_RAW_TYPE', 'The generic type '{0}' should have explicit type arguments but doesn't.', correction: 'Use explicit type arguments for '{0}'.')
SUBTYPE_OF_SEALED_CLASS → const HintCode
This hint is generated anywhere where a @sealed class or mixin is used as a super-type of a class.
HintCode('SUBTYPE_OF_SEALED_CLASS', 'The class '{0}' shouldn't be extended, mixed in, or implemented because ' 'it is sealed.', correction: 'Try composing inste…
TYPE_CHECK_IS_NOT_NULL → const HintCode
Type checks of the type x is! Null should be done with x != null.
HintCode('TYPE_CHECK_IS_NOT_NULL', 'Tests for non-null should be done with '!= null'.', correction: 'Try replacing the 'is! Null' check with '!= null'.'…
TYPE_CHECK_IS_NULL → const HintCode
Type checks of the type x is Null should be done with x == null.
HintCode('TYPE_CHECK_IS_NULL', 'Tests for null should be done with '== null'.', correction: 'Try replacing the 'is Null' check with '== null'.')
UNDEFINED_HIDDEN_NAME → const HintCode
Parameters: 0: the name of the library being imported 1: the name in the hide clause that isn't defined in the library
HintCode('UNDEFINED_HIDDEN_NAME', 'The library '{0}' doesn't export a member with the hidden name '{1}'.', correction: 'Try removing the name from the list of h…
UNDEFINED_SHOWN_NAME → const HintCode
Parameters: 0: the name of the library being imported 1: the name in the show clause that isn't defined in the library
HintCode('UNDEFINED_SHOWN_NAME', 'The library '{0}' doesn't export a member with the shown name '{1}'.', correction: 'Try removing the name from the list of sho…
UNNECESSARY_CAST → const HintCode
No parameters.
HintCode('UNNECESSARY_CAST', 'Unnecessary cast.', correction: 'Try removing the cast.', hasPublishedDocs: true)
UNNECESSARY_NO_SUCH_METHOD → const HintCode
Unnecessary noSuchMethod declaration.
HintCode('UNNECESSARY_NO_SUCH_METHOD', 'Unnecessary 'noSuchMethod' declaration.', correction: 'Try removing the declaration of 'noSuchMethod'.')
UNNECESSARY_NULL_COMPARISON_FALSE → const HintCode
No parameters.
HintCodeWithUniqueName('UNNECESSARY_NULL_COMPARISON', 'UNNECESSARY_NULL_COMPARISON_FALSE', 'The operand can't be null, so the condition is always false.', correction: '…
UNNECESSARY_NULL_COMPARISON_TRUE → const HintCode
No parameters.
HintCodeWithUniqueName('UNNECESSARY_NULL_COMPARISON', 'UNNECESSARY_NULL_COMPARISON_TRUE', 'The operand can't be null, so the condition is always true.', correction: 'Re…
UNNECESSARY_TYPE_CHECK_FALSE → const HintCode
Unnecessary type checks, the result is always false. [...]
HintCodeWithUniqueName('UNNECESSARY_TYPE_CHECK', 'UNNECESSARY_TYPE_CHECK_FALSE', 'Unnecessary type check, the result is always false.', correction: 'Try correcting the type…
UNNECESSARY_TYPE_CHECK_TRUE → const HintCode
Unnecessary type checks, the result is always true. [...]
HintCodeWithUniqueName('UNNECESSARY_TYPE_CHECK', 'UNNECESSARY_TYPE_CHECK_TRUE', 'Unnecessary type check, the result is always true.', correction: 'Try correcting the type c…
UNUSED_CATCH_CLAUSE → const HintCode
Parameters: 0: the name of the exception variable
HintCode('UNUSED_CATCH_CLAUSE', 'The exception variable '{0}' isn't used, so the 'catch' clause can be ' 'removed.', correction: 'Try removing the catch…
UNUSED_CATCH_STACK → const HintCode
Parameters: 0: the name of the stack trace variable
HintCode('UNUSED_CATCH_STACK', 'The stack trace variable '{0}' isn't used and can be removed.', correction: 'Try removing the stack trace variable, or using it.', h…
UNUSED_ELEMENT → const HintCode
Parameters: 0: the name that is declared but not referenced
HintCode('UNUSED_ELEMENT', 'The declaration '{0}' isn't referenced.', correction: 'Try removing the declaration of '{0}'.', hasPublishedDocs: true)
UNUSED_ELEMENT_PARAMETER → const HintCode
Parameters: 0: the name of the parameter that is declared but not used
HintCodeWithUniqueName('UNUSED_ELEMENT', 'HintCode.UNUSED_ELEMENT_PARAMETER', 'A value for optional parameter '{0}' isn't ever given.', correction: 'Try removin…
UNUSED_FIELD → const HintCode
Parameters: 0: the name of the unused field
HintCode('UNUSED_FIELD', 'The value of the field '{0}' isn't used.', correction: 'Try removing the field, or using it.', hasPublishedDocs: true)
UNUSED_IMPORT → const HintCode
Parameters: 0: the content of the unused import's uri
HintCode('UNUSED_IMPORT', 'Unused import: '{0}'.', correction: 'Try removing the import directive.', hasPublishedDocs: true)
UNUSED_LABEL → const HintCode
Parameters: 0: the label that isn't used
HintCode('UNUSED_LABEL', 'The label '{0}' isn't used.', correction: 'Try removing the label, or ' 'using it in either a 'break' or 'continue' st…
UNUSED_LOCAL_VARIABLE → const HintCode
Parameters: 0: the name of the unused variable
HintCode('UNUSED_LOCAL_VARIABLE', 'The value of the local variable '{0}' isn't used.', correction: 'Try removing the variable, or using it.', hasPublishedDocs: true…
UNUSED_SHOWN_NAME → const HintCode
Parameters: 0: the name that is shown but not used
HintCode('UNUSED_SHOWN_NAME', 'The name {0} is shown, but isn’t used.', correction: 'Try removing the name from the list of shown members.', hasPublishedDocs: true)