Skip to main content

Diagnostic messages

This page lists diagnostic messages produced by the Dart analyzer, with details about what those messages mean and how you can fix your code. For more information about the analyzer, see Customizing static analysis.

Diagnostic index

#

The analyzer produces the following diagnostics for code that doesn't conform to the language specification or that might work in unexpected ways.

If a diagnostic has extra documentation and guidance, click Learn more to view it.

abi_specific_integer_invalid

Classes extending 'AbiSpecificInteger' must have exactly one const constructor, no other members, and no type parameters.

Learn more
abi_specific_integer_mapping_extra

Classes extending 'AbiSpecificInteger' must have exactly one 'AbiSpecificIntegerMapping' annotation specifying the mapping from ABI to a 'NativeType' integer with a fixed size.

Learn more
abi_specific_integer_mapping_missing

Classes extending 'AbiSpecificInteger' must have exactly one 'AbiSpecificIntegerMapping' annotation specifying the mapping from ABI to a 'NativeType' integer with a fixed size.

Learn more
abi_specific_integer_mapping_unsupported

Invalid mapping to '{0}'; only mappings to 'Int8', 'Int16', 'Int32', 'Int64', 'Uint8', 'Uint16', 'UInt32', and 'Uint64' are supported.

Learn more
abstract_class_member

Members of classes can't be declared to be 'abstract'.

abstract_external_field

Fields can't be declared both 'abstract' and 'external'.

abstract_field_initializer

Abstract fields can't have initializers.

Learn more
abstract_final_base_class

An 'abstract' class can't be declared as both 'final' and 'base'.

abstract_final_interface_class

An 'abstract' class can't be declared as both 'final' and 'interface'.

abstract_late_field

Abstract fields cannot be late.

abstract_sealed_class

A 'sealed' class can't be marked 'abstract' because it's already implicitly abstract.

Learn more
abstract_static_field

Static fields can't be declared 'abstract'.

abstract_static_method

Static methods can't be declared to be 'abstract'.

abstract_super_member_reference

The {0} '{1}' is always abstract in the supertype.

Learn more
address_position

The '.address' expression can only be used as argument to a leaf native external call.

address_receiver

The receiver of '.address' must be a concrete 'TypedData', a concrete 'TypedData' '[]', an 'Array', an 'Array' '[]', a Struct field, or a Union field.

ambiguous_export

The name '{0}' is defined in the libraries '{1}' and '{2}'.

Learn more
ambiguous_extension_member_access

A member named '{0}' is defined in '{1}' and '{2}', and neither is more specific.

A member named '{0}' is defined in {1}, and none are more specific.

Learn more
ambiguous_import

The name '{0}' is defined in the libraries {1}.

Learn more
ambiguous_set_or_map_literal_both

The literal can't be either a map or a set because it contains at least one literal map entry or a spread operator spreading a 'Map', and at least one element which is neither of these.

Learn more
ambiguous_set_or_map_literal_either

This literal must be either a map or a set, but the elements don't have enough information for type inference to work.

Learn more
analysis_option_deprecated

The option '{0}' is no longer supported.

annotation_on_pointer_field

Fields in a struct class whose type is 'Pointer' shouldn't have any annotations.

Learn more
annotation_on_type_argument

Type arguments can't have annotations because they aren't declarations.

annotation_space_before_parenthesis

Annotations can't have spaces or comments before the parenthesis.

annotation_with_type_arguments

An annotation can't use type arguments.

annotation_with_type_arguments_uninstantiated

An annotation with type arguments must be followed by an argument list.

argument_must_be_a_constant

Argument '{0}' must be a constant.

Learn more
argument_must_be_native

Argument to 'Native.addressOf' must be annotated with @Native

Learn more
argument_type_not_assignable

The argument type '{0}' can't be assigned to the parameter type '{1}'. {2}

Learn more
argument_type_not_assignable_to_error_handler

The argument type '{0}' can't be assigned to the parameter type '{1} Function(Object)' or '{1} Function(Object, StackTrace)'.

Learn more
assert_in_redirecting_constructor

A redirecting constructor can't have an 'assert' initializer.

Learn more
asset_directory_does_not_exist

The asset directory '{0}' doesn't exist.

Learn more
asset_does_not_exist

The asset file '{0}' doesn't exist.

Learn more
asset_field_not_list

The value of the 'assets' field is expected to be a list of relative file paths.

Learn more
asset_missing_path

Asset map entry must contain a 'path' field.

Learn more
asset_not_string

Assets are required to be file paths (strings).

Learn more
asset_not_string_or_map

An asset value is required to be a file path (string) or map.

Learn more
asset_path_not_string

Asset paths are required to be file paths (strings).

Learn more
assignment_of_do_not_store

'{0}' is marked 'doNotStore' and shouldn't be assigned to a field or top-level variable.

Learn more
assignment_to_const

Constant variables can't be assigned a value after initialization.

Learn more
assignment_to_final

'{0}' can't be used as a setter because it's final.

Learn more
assignment_to_final_local

The final variable '{0}' can only be set once.

Learn more
assignment_to_final_no_setter

There isn't a setter named '{0}' in class '{1}'.

Learn more
assignment_to_function

Functions can't be assigned a value.

Learn more
assignment_to_method

Methods can't be assigned a value.

Learn more
assignment_to_type

Types can't be assigned a value.

Learn more
async_for_in_wrong_context

The async for-in loop can only be used in an async function.

Learn more
async_keyword_used_as_identifier

The keywords 'await' and 'yield' can't be used as identifiers in an asynchronous or generator function.

augmentation_extends_clause_already_present

The augmentation has an 'extends' clause, but an augmentation target already includes an 'extends' clause and it isn't allowed to be repeated or changed.

augmentation_modifier_extra

The augmentation has the '{0}' modifier that the declaration doesn't have.

augmentation_modifier_missing

The augmentation is missing the '{0}' modifier that the declaration has.

augmentation_of_different_declaration_kind

Can't augment a {0} with a {1}.

augmentation_type_parameter_bound

The augmentation type parameter must have the same bound as the corresponding type parameter of the declaration.

augmentation_type_parameter_count

The augmentation must have the same number of type parameters as the declaration.

augmentation_type_parameter_name

The augmentation type parameter must have the same name as the corresponding type parameter of the declaration.

augmentation_without_declaration

The declaration being augmented doesn't exist.

augmented_expression_is_not_setter

The augmented declaration is not a setter, it can't be used to write a value.

augmented_expression_is_setter

The augmented declaration is a setter, it can't be used to read a value.

augmented_expression_not_operator

The enclosing augmentation doesn't augment the operator '{0}'.

await_in_late_local_variable_initializer

The 'await' expression can't be used in a 'late' local variable's initializer.

Learn more
await_in_wrong_context

The await expression can only be used in an async function.

await_of_incompatible_type

The 'await' expression can't be used for an expression with an extension type that is not a subtype of 'Future'.

Learn more
base_enum

Enums can't be declared to be 'base'.

binary_operator_written_out

Binary operator '{0}' is written as '{1}' instead of the written out word.

body_might_complete_normally

The body might complete normally, causing 'null' to be returned, but the return type, '{0}', is a potentially non-nullable type.

Learn more
body_might_complete_normally_catch_error

This 'onError' handler must return a value assignable to '{0}', but ends without returning a value.

Learn more
body_might_complete_normally_nullable

This function has a nullable return type of '{0}', but ends without returning a value.

Learn more
break_label_on_switch_member

A break label resolves to the 'case' or 'default' statement.

Learn more
break_outside_of_loop

A break statement can't be used outside of a loop or switch statement.

built_in_identifier_as_type

The built-in identifier '{0}' can't be used as a type.

Learn more
built_in_identifier_in_declaration

The built-in identifier '{0}' can't be used as a prefix name.

The built-in identifier '{0}' can't be used as a type name.

The built-in identifier '{0}' can't be used as a type parameter name.

The built-in identifier '{0}' can't be used as a typedef name.

The built-in identifier '{0}' can't be used as an extension name.

The built-in identifier '{0}' can't be used as an extension type name.

Learn more
camera_permissions_incompatible

Camera permissions make app incompatible for Chrome OS, consider adding optional features "android.hardware.camera" and "android.hardware.camera.autofocus".

case_block_not_terminated

The last statement of the 'case' should be 'break', 'continue', 'rethrow', 'return', or 'throw'.

Learn more
case_expression_type_implements_equals

The switch case expression type '{0}' can't override the '==' operator.

Learn more
case_expression_type_is_not_switch_expression_subtype

The switch case expression type '{0}' must be a subtype of the switch expression type '{1}'.

Learn more
cast_from_nullable_always_fails

This cast will always throw an exception because the nullable local variable '{0}' is not assigned.

Learn more
cast_from_null_always_fails

This cast always throws an exception because the expression always evaluates to 'null'.

Learn more
cast_to_non_type

The name '{0}' isn't a type, so it can't be used in an 'as' expression.

Learn more
catch_syntax

'catch' must be followed by '(identifier)' or '(identifier, identifier)'.

catch_syntax_extra_parameters

'catch' must be followed by '(identifier)' or '(identifier, identifier)'.

class_instantiation_access_to_member

The class '{0}' doesn't have a constructor named '{1}'.

The instance member '{0}' can't be accessed on a class instantiation.

The static member '{0}' can't be accessed on a class instantiation.

class_in_class

Classes can't be declared inside other classes.

class_used_as_mixin

The class '{0}' can't be used as a mixin because it's neither a mixin class nor a mixin.

Learn more
collection_element_from_deferred_library

Constant values from a deferred library can't be used as keys in a 'const' map literal.

Constant values from a deferred library can't be used as values in a 'const' constructor.

Constant values from a deferred library can't be used as values in a 'const' list literal.

Constant values from a deferred library can't be used as values in a 'const' map literal.

Constant values from a deferred library can't be used as values in a 'const' set literal.

Learn more
colon_in_place_of_in

For-in loops use 'in' rather than a colon.

compound_implements_finalizable

The class '{0}' can't implement Finalizable.

Learn more
concrete_class_has_enum_superinterface

Concrete classes can't have 'Enum' as a superinterface.

Learn more
concrete_class_with_abstract_member

'{0}' must have a method body because '{1}' isn't abstract.

Learn more
conflicting_constructor_and_static_member

'{0}' can't be used to name both a constructor and a static field in this class.

'{0}' can't be used to name both a constructor and a static getter in this class.

'{0}' can't be used to name both a constructor and a static method in this class.

'{0}' can't be used to name both a constructor and a static setter in this class.

Learn more
conflicting_field_and_method

Class '{0}' can't define field '{1}' and have method '{2}.{1}' with the same name.

conflicting_generic_interfaces

The {0} '{1}' can't implement both '{2}' and '{3}' because the type arguments are different.

Learn more
conflicting_inherited_method_and_setter

The {0} '{1}' can't inherit both a method and a setter named '{2}'.

conflicting_method_and_field

Class '{0}' can't define method '{1}' and have field '{2}.{1}' with the same name.

conflicting_modifiers

Members can't be declared to be both '{0}' and '{1}'.

conflicting_static_and_instance

Class '{0}' can't define static member '{1}' and have instance member '{2}.{1}' with the same name.

conflicting_type_variable_and_container

'{0}' can't be used to name both a type parameter and the class in which the type parameter is defined.

'{0}' can't be used to name both a type parameter and the enum in which the type parameter is defined.

'{0}' can't be used to name both a type parameter and the extension in which the type parameter is defined.

'{0}' can't be used to name both a type parameter and the extension type in which the type parameter is defined.

'{0}' can't be used to name both a type parameter and the mixin in which the type parameter is defined.

Learn more
conflicting_type_variable_and_member

'{0}' can't be used to name both a type parameter and a member in this class.

'{0}' can't be used to name both a type parameter and a member in this enum.

'{0}' can't be used to name both a type parameter and a member in this extension type.

'{0}' can't be used to name both a type parameter and a member in this extension.

'{0}' can't be used to name both a type parameter and a member in this mixin.

Learn more
constant_pattern_never_matches_value_type

The matched value type '{0}' can never be equal to this constant of type '{1}'.

Learn more
constant_pattern_with_non_constant_expression

The expression of a constant pattern must be a valid constant.

Learn more
constructor_with_return_type

Constructors can't have a return type.

constructor_with_type_arguments

A constructor invocation can't have type arguments after the constructor name.

const_and_final

Members can't be declared to be both 'const' and 'final'.

const_class

Classes can't be declared to be 'const'.

const_constructor_field_type_mismatch

In a const constructor, a value of type '{0}' can't be assigned to the field '{1}', which has type '{2}'.

const_constructor_param_type_mismatch

A value of type '{0}' can't be assigned to a parameter of type '{1}' in a const constructor.

Learn more
const_constructor_throws_exception

Const constructors can't throw exceptions.

const_constructor_with_body

Const constructors can't have a body.

const_constructor_with_field_initialized_by_non_const

Can't define the 'const' constructor because the field '{0}' is initialized with a non-constant value.

Learn more
const_constructor_with_mixin_with_field

This constructor can't be declared 'const' because a mixin adds the instance field: {0}.

This constructor can't be declared 'const' because the mixins add the instance fields: {0}.

const_constructor_with_non_const_super

A constant constructor can't call a non-constant super constructor of '{0}'.

Learn more
const_constructor_with_non_final_field

Can't define a const constructor for a class with non-final fields.

Learn more
const_deferred_class

Deferred classes can't be created with 'const'.

Learn more
const_eval_assertion_failure

The assertion in this constant expression failed.

const_eval_assertion_failure_with_message

An assertion failed with message '{0}'.

const_eval_extension_method

Extension methods can't be used in constant expressions.

const_eval_extension_type_method

Extension type methods can't be used in constant expressions.

const_eval_for_element

Constant expressions don't support 'for' elements.

const_eval_method_invocation

Methods can't be invoked in constant expressions.

const_eval_null_aware_access

Null-aware property access can't be used in a constant expression.

const_eval_primitive_equality

In constant expressions, operands of the equality operator must have primitive equality.

const_eval_property_access

The property '{0}' can't be accessed on the type '{1}' in a constant expression.

const_eval_throws_exception

Evaluation of this constant expression throws an exception.

const_eval_throws_idbze

Evaluation of this constant expression throws an IntegerDivisionByZeroException.

const_eval_type_bool

In constant expressions, operands of this operator must be of type 'bool'.

const_eval_type_bool_int

In constant expressions, operands of this operator must be of type 'bool' or 'int'.

const_eval_type_bool_num_string

In constant expressions, operands of this operator must be of type 'bool', 'num', 'String' or 'null'.

const_eval_type_int

In constant expressions, operands of this operator must be of type 'int'.

const_eval_type_num

In constant expressions, operands of this operator must be of type 'num'.

const_eval_type_num_string

In constant expressions, operands of this operator must be of type 'num' or 'String'.

const_eval_type_string

In constant expressions, operands of this operator must be of type 'String'.

const_eval_type_type

In constant expressions, operands of this operator must be of type 'Type'.

const_factory

Only redirecting factory constructors can be declared to be 'const'.

const_initialized_with_non_constant_value

Const variables must be initialized with a constant value.

Learn more
const_initialized_with_non_constant_value_from_deferred_library

Constant values from a deferred library can't be used to initialize a 'const' variable.

Learn more
const_instance_field

Only static fields can be declared as const.

Learn more
const_map_key_not_primitive_equality

The type of a key in a constant map can't override the '==' operator, or 'hashCode', but the class '{0}' does.

Learn more
const_method

Getters, setters and methods can't be declared to be 'const'.

const_not_initialized

The constant '{0}' must be initialized.

Learn more
const_set_element_not_primitive_equality

An element in a constant set can't override the '==' operator, or 'hashCode', but the type '{0}' does.

Learn more
const_spread_expected_list_or_set

A list or a set is expected in this spread.

Learn more
const_spread_expected_map

A map is expected in this spread.

Learn more
const_type_parameter

Type parameters can't be used in a constant expression.

const_with_non_const

The constructor being called isn't a const constructor.

Learn more
const_with_non_constant_argument

Arguments of a constant creation must be constant expressions.

Learn more
const_with_type_parameters

A constant constructor tearoff can't use a type parameter as a type argument.

A constant creation can't use a type parameter as a type argument.

A constant function tearoff can't use a type parameter as a type argument.

Learn more
const_with_undefined_constructor

The class '{0}' doesn't have a constant constructor '{1}'.

const_with_undefined_constructor_default

The class '{0}' doesn't have an unnamed constant constructor.

continue_label_invalid

The label used in a 'continue' statement must be defined on either a loop or a switch member.

Learn more
continue_outside_of_loop

A continue statement can't be used outside of a loop or switch statement.

continue_without_label_in_case

A continue statement in a switch statement must have a label as a target.

could_not_infer

Couldn't infer type parameter '{0}'.{1}

covariant_and_static

Members can't be declared to be both 'covariant' and 'static'.

covariant_constructor

A constructor can't be declared to be 'covariant'.

covariant_member

Getters, setters and methods can't be declared to be 'covariant'.

creation_of_struct_or_union

Subclasses of 'Struct' and 'Union' are backed by native memory, and can't be instantiated by a generative constructor.

Learn more
creation_with_non_type

The name '{0}' isn't a class.

Learn more
dead_code

Dead code.

Dead code: The assigned-to wildcard variable is marked late and can never be referenced so this initializer will never be evaluated.

Learn more
dead_code_catch_following_catch

Dead code: Catch clauses after a 'catch (e)' or an 'on Object catch (e)' are never reached.

Learn more
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 already.

Learn more
dead_null_aware_expression

The left operand can't be null, so the right operand is never executed.

Learn more
declaration_named_augmented_inside_augmentation

The identifier 'augmented' has a special meaning inside augmenting declarations.

default_in_switch_expression

A switch expression may not use the default keyword.

default_list_constructor

The default 'List' constructor isn't available when null safety is enabled.

Learn more
default_value_in_function_type

Parameters in a function type can't have default values.

Learn more
default_value_in_redirecting_factory_constructor

Default values aren't allowed in factory constructors that redirect to another constructor.

Learn more
default_value_on_required_parameter

Required named parameters can't have a default value.

Learn more
deferred_after_prefix

The deferred keyword should come immediately before the prefix ('as' clause).

deferred_import_of_extension

Imports of deferred libraries must hide all extensions.

Learn more
definitely_unassigned_late_local_variable

The late local variable '{0}' is definitely unassigned at this point.

Learn more
dependencies_field_not_map

The value of the '{0}' field is expected to be a map.

Learn more
deprecated_colon_for_default_value

Using a colon as the separator before a default value is deprecated and will not be supported in language version 3.0 and later.

Learn more
deprecated_export_use

The ability to import '{0}' indirectly is deprecated.

Learn more
deprecated_field

The '{0}' field is no longer used and can be removed.

Learn more
deprecated_lint

'{0}' is a deprecated lint rule and should not be used.

deprecated_lint_with_replacement

'{0}' is deprecated and should be replaced by '{1}'.

deprecated_member_use

'{0}' is deprecated and shouldn't be used.

'{0}' is deprecated and shouldn't be used. {1}

Learn more
deprecated_member_use_from_same_package

'{0}' is deprecated and shouldn't be used.

'{0}' is deprecated and shouldn't be used. {1}

Learn more
deprecated_new_in_comment_reference

Using the 'new' keyword in a comment reference is deprecated.

Learn more
deprecated_subtype_of_function

Extending 'Function' is deprecated.

Implementing 'Function' has no effect.

Mixing in 'Function' is deprecated.

Learn more
directive_after_declaration

Directives must appear before any declarations.

disallowed_type_instantiation_expression

Only a generic type, generic function, generic instance method, or generic constructor can have type arguments.

Learn more
division_optimization

The operator x ~/ y is more efficient than (x / y).toInt().

Learn more
doc_directive_argument_wrong_format

The '{0}' argument must be formatted as {1}.

doc_directive_has_extra_arguments

The '{0}' directive has '{1}' arguments, but only '{2}' are expected.

doc_directive_has_unexpected_named_argument

The '{0}' directive has an unexpected named argument, '{1}'.

doc_directive_missing_argument

The '{0}' directive is missing a '{1}' and a '{2}' argument.

The '{0}' directive is missing a '{1}' argument.

The '{0}' directive is missing a '{1}', a '{2}', and a '{3}' argument.

doc_directive_missing_closing_brace

Doc directive is missing a closing curly brace ('}').

doc_directive_missing_closing_tag

Doc directive is missing a closing tag.

doc_directive_missing_opening_tag

Doc directive is missing an opening tag.

doc_directive_unknown

Doc directive '{0}' is unknown.

doc_import_cannot_be_deferred

Doc imports can't be deferred.

doc_import_cannot_have_combinators

Doc imports can't have show or hide combinators.

doc_import_cannot_have_configurations

Doc imports can't have configurations.

doc_import_cannot_have_prefix

Doc imports can't have prefixes.

dot_shorthand_missing_context

A dot shorthand can't be used where there is no context type.

dot_shorthand_undefined_member

The static getter '{0}' isn't defined for the context type '{1}'.

The static method or constructor '{0}' isn't defined for the type '{1}'.

duplicated_modifier

The modifier '{0}' was already specified.

duplicate_constructor

The constructor with name '{0}' is already defined.

The unnamed constructor is already defined.

Learn more
duplicate_deferred

An import directive can only have one 'deferred' keyword.

duplicate_definition

The name '{0}' is already defined.

Learn more
duplicate_export

Duplicate export.

Learn more
duplicate_field_formal_parameter

The field '{0}' can't be initialized by multiple parameters in the same constructor.

Learn more
duplicate_field_name

The field name '{0}' is already used in this record.

Learn more
duplicate_hidden_name

Duplicate hidden name.

Learn more
duplicate_ignore

The diagnostic '{0}' doesn't need to be ignored here because it's already being ignored.

Learn more
duplicate_import

Duplicate import.

Learn more
duplicate_label_in_switch_statement

The label '{0}' was already used in this switch statement.

duplicate_named_argument

The argument for the named parameter '{0}' was already specified.

Learn more
duplicate_part

The library already contains a part with the URI '{0}'.

Learn more
duplicate_pattern_assignment_variable

The variable '{0}' is already assigned in this pattern.

Learn more
duplicate_pattern_field

The field '{0}' is already matched in this pattern.

Learn more
duplicate_prefix

An import directive can only have one prefix ('as' clause).

duplicate_rest_element_in_pattern

At most one rest element is allowed in a list or map pattern.

Learn more
duplicate_rule

The rule {0} is already specified and doesn't need to be specified again.

duplicate_shown_name

Duplicate shown name.

Learn more
duplicate_variable_pattern

The variable '{0}' is already defined in this pattern.

Learn more
empty_enum_body

An enum must declare at least one constant name.

empty_map_pattern

A map pattern must have at least one entry.

Learn more
empty_record_literal_with_comma

A record literal without fields can't have a trailing comma.

Learn more
empty_record_type_named_fields_list

The list of named fields in a record type can't be empty.

Learn more
empty_record_type_with_comma

A record type without fields can't have a trailing comma.

Learn more
empty_struct

The class '{0}' can't be empty because it's a subclass of '{1}'.

Learn more
enum_constant_invokes_factory_constructor

An enum value can't invoke a factory constructor.

enum_constant_same_name_as_enclosing

The name of the enum value can't be the same as the enum's name.

Learn more
enum_constant_with_non_const_constructor

The invoked constructor isn't a 'const' constructor.

Learn more
enum_instantiated_to_bounds_is_not_well_bounded

The result of instantiating the enum to bounds is not well-bounded.

enum_in_class

Enums can't be declared inside classes.

enum_mixin_with_instance_variable

Mixins applied to enums can't have instance variables.

Learn more
enum_without_constants

The enum must have at least one enum constant.

enum_with_abstract_member

'{0}' must have a method body because '{1}' is an enum.

Learn more
enum_with_name_values

The name 'values' is not a valid name for an enum.

Learn more
equality_cannot_be_equality_operand

A comparison expression can't be an operand of another comparison expression.

equal_elements_in_const_set

Two elements in a constant set literal can't be equal.

Learn more
equal_elements_in_set

Two elements in a set literal shouldn't be equal.

Learn more
equal_keys_in_const_map

Two keys in a constant map literal can't be equal.

Learn more
equal_keys_in_map

Two keys in a map literal shouldn't be equal.

Learn more
equal_keys_in_map_pattern

Two keys in a map pattern can't be equal.

Learn more
expected_body

A catch clause must have a body, even if it is empty.

A class declaration must have a body, even if it is empty.

A finally clause must have a body, even if it is empty.

A mixin declaration must have a body, even if it is empty.

A switch expression must have a body, even if it is empty.

A switch statement must have a body, even if it is empty.

A try statement must have a body, even if it is empty.

An extension declaration must have a body, even if it is empty.

An extension type declaration must have a body, even if it is empty.

expected_case_or_default

Expected 'case' or 'default'.

expected_class_member

Expected a class member.

expected_else_or_comma

Expected 'else' or comma.

expected_executable

Expected a method, getter, setter or operator declaration.

expected_identifier_but_got_keyword

'{0}' can't be used as an identifier because it's a keyword.

expected_instead

Expected '{0}' instead of this.

expected_list_or_map_literal

Expected a list or map literal.

expected_named_type

Expected a class name.

Expected a mixin name.

Expected the name of a class or mixin.

expected_one_list_pattern_type_arguments

List patterns require one type argument or none, but {0} found.

Learn more
expected_one_list_type_arguments

List literals require one type argument or none, but {0} found.

Learn more
expected_one_set_type_arguments

Set literals require one type argument or none, but {0} were found.

Learn more
expected_representation_field

Expected a representation field.

expected_representation_type

Expected a representation type.

expected_string_literal

Expected a string literal.

expected_token

Expected to find '{0}'.

expected_two_map_pattern_type_arguments

Map patterns require two type arguments or none, but {0} found.

Learn more
expected_two_map_type_arguments

Map literals require two type arguments or none, but {0} found.

Learn more
expected_type_name

Expected a type name.

experiment_not_enabled

This requires the '{0}' language feature to be enabled.

experiment_not_enabled_off_by_default

This requires the experimental '{0}' language feature to be enabled.

export_directive_after_part_directive

Export directives must precede part directives.

export_internal_library

The library '{0}' is internal and can't be exported.

Learn more
export_legacy_symbol

The symbol '{0}' is defined in a legacy library, and can't be re-exported from a library with null safety enabled.

Learn more
export_of_non_library

The exported library '{0}' can't have a part-of directive.

Learn more
expression_in_map

Expressions can't be used in a map literal.

Learn more
extends_non_class

Classes can only extend other classes.

Learn more
extension_as_expression

Extension '{0}' can't be used as an expression.

Learn more
extension_augmentation_has_on_clause

Extension augmentations can't have 'on' clauses.

extension_conflicting_static_and_instance

An extension can't define static member '{0}' and an instance member with the same name.

Learn more
extension_declares_abstract_member

Extensions can't declare abstract members.

Learn more
extension_declares_constructor

Extensions can't declare constructors.

Learn more
extension_declares_instance_field

Extensions can't declare instance fields.

Learn more
extension_declares_member_of_object

Extensions can't declare members with the same name as a member declared by 'Object'.

Learn more
extension_override_access_to_static_member

An extension override can't be used to access a static member from an extension.

Learn more
extension_override_argument_not_assignable

The type of the argument to the extension override '{0}' isn't assignable to the extended type '{1}'.

Learn more
extension_override_without_access

An extension override can only be used to access instance members.

Learn more
extension_override_with_cascade

Extension overrides have no value so they can't be used as the receiver of a cascade expression.

Learn more
extension_type_constructor_with_super_formal_parameter

Extension type constructors can't declare super formal parameters.

Learn more
extension_type_constructor_with_super_invocation

Extension type constructors can't include super initializers.

Learn more
extension_type_declares_instance_field

Extension types can't declare instance fields.

Learn more
extension_type_declares_member_of_object

Extension types can't declare members with the same name as a member declared by 'Object'.

Learn more
extension_type_extends

An extension type declaration can't have an 'extends' clause.

extension_type_implements_disallowed_type

Extension types can't implement '{0}'.

Learn more
extension_type_implements_itself

The extension type can't implement itself.

Learn more
extension_type_implements_not_supertype

'{0}' is not a supertype of '{1}', the representation type.

Learn more
extension_type_implements_representation_not_supertype

'{0}', the representation type of '{1}', is not a supertype of '{2}', the representation type of '{3}'.

Learn more
extension_type_inherited_member_conflict

The extension type '{0}' has more than one distinct member named '{1}' from implemented types.

Learn more
extension_type_representation_depends_on_itself

The extension type representation can't depend on itself.

Learn more
extension_type_representation_type_bottom

The representation type can't be a bottom type.

Learn more
extension_type_with

An extension type declaration can't have a 'with' clause.

extension_type_with_abstract_member

'{0}' must have a method body because '{1}' is an extension type.

Learn more
external_class

Classes can't be declared to be 'external'.

external_constructor_with_body

External constructors can't have a body.

external_constructor_with_field_initializers

An external constructor can't initialize fields.

external_constructor_with_initializer

An external constructor can't have any initializers.

external_enum

Enums can't be declared to be 'external'.

external_factory_redirection

A redirecting factory can't be external.

external_factory_with_body

External factories can't have a body.

external_field

Fields can't be declared to be 'external'.

external_getter_with_body

External getters can't have a body.

external_late_field

External fields cannot be late.

external_method_with_body

An external or native method can't have a body.

external_operator_with_body

External operators can't have a body.

external_setter_with_body

External setters can't have a body.

external_typedef

Typedefs can't be declared to be 'external'.

external_with_initializer

External fields can't have initializers.

External variables can't have initializers.

Learn more
extraneous_modifier

Can't have modifier '{0}' here.

extraneous_modifier_in_extension_type

Can't have modifier '{0}' in an extension type.

extraneous_modifier_in_primary_constructor

Can't have modifier '{0}' in a primary constructor.

extra_annotation_on_struct_field

Fields in a struct class must have exactly one annotation indicating the native type.

Learn more
extra_positional_arguments

Too many positional arguments: {0} expected, but {1} found.

Learn more
extra_positional_arguments_could_be_named

Too many positional arguments: {0} expected, but {1} found.

Learn more
extra_size_annotation_carray

'Array's must have exactly one 'Array' annotation.

Learn more
factory_top_level_declaration

Top-level declarations can't be declared to be 'factory'.

factory_without_body

A non-redirecting 'factory' constructor must have a body.

factory_with_initializers

A 'factory' constructor can't have initializers.

ffi_native_invalid_duplicate_default_asset

There may be at most one @DefaultAsset annotation on a library.

Learn more
ffi_native_invalid_multiple_annotations

Native functions and fields must have exactly one @Native annotation.

Learn more
ffi_native_must_be_external

Native functions must be declared external.

Learn more
ffi_native_only_classes_extending_nativefieldwrapperclass1_can_be_pointer

Only classes extending NativeFieldWrapperClass1 can be passed as Pointer.

ffi_native_unexpected_number_of_parameters

Unexpected number of Native annotation parameters. Expected {0} but has {1}.

Learn more
ffi_native_unexpected_number_of_parameters_with_receiver

Unexpected number of Native annotation parameters. Expected {0} but has {1}. Native instance method annotation must have receiver as first argument.

Learn more
field_initialized_by_multiple_initializers

The field '{0}' can't be initialized twice in the same constructor.

Learn more
field_initialized_in_initializer_and_declaration

Fields can't be initialized in the constructor if they are final and were already initialized at their declaration.

Learn more
field_initialized_in_parameter_and_initializer

Fields can't be initialized in both the parameter list and the initializers.

Learn more
field_initialized_outside_declaring_class

A field can only be initialized in its declaring class

field_initializer_factory_constructor

Initializing formal parameters can't be used in factory constructors.

Learn more
field_initializer_in_struct

Constructors in subclasses of 'Struct' and 'Union' can't have field initializers.

Learn more
field_initializer_not_assignable

The initializer type '{0}' can't be assigned to the field type '{1}' in a const constructor.

The initializer type '{0}' can't be assigned to the field type '{1}'.

Learn more
field_initializer_outside_constructor

Field formal parameters can only be used in a constructor.

Initializing formal parameters can only be used in constructors.

Learn more
field_initializer_redirecting_constructor

The redirecting constructor can't have a field initializer.

Learn more
field_initializing_formal_not_assignable

The parameter type '{0}' is incompatible with the field type '{1}'.

Learn more
field_in_struct_with_initializer

Fields in subclasses of 'Struct' and 'Union' can't have initializers.

Learn more
field_must_be_external_in_struct

Fields of 'Struct' and 'Union' subclasses must be marked external.

Learn more
final_and_covariant

Members can't be declared to be both 'final' and 'covariant'.

final_and_covariant_late_with_initializer

Members marked 'late' with an initializer can't be declared to be both 'final' and 'covariant'.

final_and_var

Members can't be declared to be both 'final' and 'var'.

final_constructor

A constructor can't be declared to be 'final'.

final_enum

Enums can't be declared to be 'final'.

final_initialized_in_declaration_and_constructor

'{0}' is final and was given a value when it was declared, so it can't be set to a new value.

Learn more
final_method

Getters, setters and methods can't be declared to be 'final'.

final_mixin

A mixin can't be declared 'final'.

final_mixin_class

A mixin class can't be declared 'final'.

final_not_initialized

The final variable '{0}' must be initialized.

Learn more
final_not_initialized_constructor

All final variables must be initialized, but '{0}' and '{1}' aren't.

All final variables must be initialized, but '{0}' isn't.

All final variables must be initialized, but '{0}', '{1}', and {2} others aren't.

Learn more
flutter_field_not_map

The value of the 'flutter' field is expected to be a map.

Learn more
for_in_of_invalid_element_type

The type '{0}' used in the 'for' loop must implement '{1}' with a type argument that can be assigned to '{2}'.

Learn more
for_in_of_invalid_type

The type '{0}' used in the 'for' loop must implement '{1}'.

Learn more
for_in_with_const_variable

A for-in loop variable can't be a 'const'.

Learn more
function_typed_parameter_var

Function-typed parameters can't specify 'const', 'final' or 'var' in place of a return type.

generic_function_type_cannot_be_bound

Generic function types can't be used as type parameter bounds.

generic_function_type_cannot_be_type_argument

A generic function type can't be a type argument.

generic_method_type_instantiation_on_dynamic

A method tear-off on a receiver whose type is 'dynamic' can't have type arguments.

Learn more
generic_struct_subclass

The class '{0}' can't extend 'Struct' or 'Union' because '{0}' is generic.

Learn more
getter_constructor

Constructors can't be a getter.

getter_in_function

Getters can't be defined within methods or functions.

getter_not_assignable_setter_types

The return type of getter '{0}' is '{1}' which isn't assignable to the type '{2}' of its setter '{3}'.

getter_not_subtype_setter_types

The return type of getter '{0}' is '{1}' which isn't a subtype of the type '{2}' of its setter '{3}'.

Learn more
getter_with_parameters

Getters must be declared without a parameter list.

if_element_condition_from_deferred_library

Constant values from a deferred library can't be used as values in an if condition inside a const collection literal.

illegal_assignment_to_non_assignable

Illegal assignment to non-assignable expression.

illegal_async_generator_return_type

Functions marked 'async*' must have a return type that is a supertype of 'Stream' for some type 'T'.

Learn more
illegal_async_return_type

Functions marked 'async' must have a return type which is a supertype of 'Future'.

Learn more
illegal_concrete_enum_member

A concrete instance member named '{0}' can't be declared in a class that implements 'Enum'.

A concrete instance member named '{0}' can't be inherited from '{1}' in a class that implements 'Enum'.

Learn more
illegal_enum_values

An instance member named 'values' can't be declared in a class that implements 'Enum'.

An instance member named 'values' can't be inherited from '{0}' in a class that implements 'Enum'.

Learn more
illegal_language_version_override

The language version must be {0}.

illegal_pattern_assignment_variable_name

A variable assigned by a pattern assignment can't be named '{0}'.

illegal_pattern_identifier_name

A pattern can't refer to an identifier named '{0}'.

illegal_pattern_variable_name

The variable declared by a variable pattern can't be named '{0}'.

illegal_sync_generator_return_type

Functions marked 'sync*' must have a return type that is a supertype of 'Iterable' for some type 'T'.

Learn more
implements_before_extends

The extends clause must be before the implements clause.

implements_before_on

The on clause must be before the implements clause.

implements_before_with

The with clause must be before the implements clause.

implements_non_class

Classes and mixins can only implement other classes and mixins.

Learn more
implements_repeated

'{0}' can only be implemented once.

Learn more
implements_super_class

'{0}' can't be used in both the 'extends' and 'implements' clauses.

'{0}' can't be used in both the 'extends' and 'with' clauses.

Learn more
implicit_super_initializer_missing_arguments

The implicitly invoked unnamed constructor from '{0}' has required parameters.

Learn more
implicit_this_reference_in_initializer

The instance member '{0}' can't be accessed in an initializer.

Learn more
import_deferred_library_with_load_function

The imported library defines a top-level function named 'loadLibrary' that is hidden by deferring this library.

Learn more
import_directive_after_part_directive

Import directives must precede part directives.

import_internal_library

The library '{0}' is internal and can't be imported.

Learn more
import_of_legacy_library_into_null_safe

The library '{0}' is legacy, and shouldn't be imported into a null safe library.

Learn more
import_of_non_library

The imported library '{0}' can't have a part-of directive.

Learn more
included_file_parse_error

{3} in {0}({1}..{2})

included_file_warning

Warning in the included options file {0}({1}..{2}): {3}

include_file_not_found

The include file '{0}' in '{1}' can't be found when analyzing '{2}'.

incompatible_lint

The rule '{0}' is incompatible with the rule '{1}'.

inconsistent_case_expression_types

Case expressions must have the same types, '{0}' isn't a '{1}'.

inconsistent_inheritance

Superinterfaces don't have a valid override for '{0}': {1}.

Learn more
inconsistent_inheritance_getter_and_method

'{0}' is inherited as a getter (from '{1}') and also a method (from '{2}').

inconsistent_language_version_override

Parts must have exactly the same language version override as the library.

Learn more
inconsistent_pattern_variable_logical_or

The variable '{0}' has a different type and/or finality in this branch of the logical-or pattern.

Learn more
inference_failure_on_collection_literal

The type argument(s) of '{0}' can't be inferred.

inference_failure_on_function_invocation

The type argument(s) of the function '{0}' can't be inferred.

inference_failure_on_function_return_type

The return type of '{0}' cannot be inferred.

inference_failure_on_generic_invocation

The type argument(s) of the generic function type '{0}' can't be inferred.

inference_failure_on_instance_creation

The type argument(s) of the constructor '{0}' can't be inferred.

inference_failure_on_uninitialized_variable

The type of {0} can't be inferred without either a type or initializer.

inference_failure_on_untyped_parameter

The type of {0} can't be inferred; a type must be explicitly provided.

initialized_variable_in_for_each

The loop variable in a for-each loop can't be initialized.

initializer_for_non_existent_field

'{0}' isn't a field in the enclosing class.

Learn more
initializer_for_static_field

'{0}' is a static field in the enclosing class. Fields initialized in a constructor can't be static.

Learn more
initializing_formal_for_non_existent_field

'{0}' isn't a field in the enclosing class.

Learn more
instance_access_to_static_member

The static {1} '{0}' can't be accessed through an instance.

Learn more
instance_member_access_from_factory

Instance members can't be accessed from a factory constructor.

Learn more
instance_member_access_from_static

Instance members can't be accessed from a static method.

Learn more
instantiate_abstract_class

Abstract classes can't be instantiated.

Learn more
instantiate_enum

Enums can't be instantiated.

Learn more
instantiate_type_alias_expands_to_type_parameter

Type aliases that expand to a type parameter can't be instantiated.

Learn more
integer_literal_imprecise_as_double

The integer literal is being used as a double, but can't be represented as a 64-bit double without overflow or loss of precision: '{0}'.

Learn more
integer_literal_out_of_range

The integer literal {0} can't be represented in 64 bits.

Learn more
interface_enum

Enums can't be declared to be 'interface'.

interface_mixin

A mixin can't be declared 'interface'.

interface_mixin_class

A mixin class can't be declared 'interface'.

invalid_annotation

Annotation must be either a const variable reference or const constructor invocation.

Learn more
invalid_annotation_constant_value_from_deferred_library

Constant values from a deferred library can't be used in annotations.

Learn more
invalid_annotation_from_deferred_library

Constant values from a deferred library can't be used as annotations.

Learn more
invalid_annotation_target

The annotation '{0}' can only be used on {1}.

Learn more
invalid_assignment

A value of type '{0}' can't be assigned to a variable of type '{1}'.

Learn more
invalid_await_in_for

The keyword 'await' isn't allowed for a normal 'for' statement.

invalid_await_not_required_annotation

The annotation 'awaitNotRequired' can only be applied to a Future-returning function, or a Future-typed field.

Learn more
invalid_cast_function

The function '{0}' has type '{1}' that isn't of expected type '{2}'. This means its parameter or return type doesn't match what is expected.

invalid_cast_function_expr

The function expression type '{0}' isn't of type '{1}'. This means its parameter or return type doesn't match what is expected. Consider changing parameter type(s) or the returned type(s).

invalid_cast_literal

The literal '{0}' with type '{1}' isn't of expected type '{2}'.

invalid_cast_literal_list

The list literal type '{0}' isn't of expected type '{1}'. The list's type can be changed with an explicit generic type argument or by changing the element types.

invalid_cast_literal_map

The map literal type '{0}' isn't of expected type '{1}'. The map's type can be changed with an explicit generic type arguments or by changing the key and value types.

invalid_cast_literal_set

The set literal type '{0}' isn't of expected type '{1}'. The set's type can be changed with an explicit generic type argument or by changing the element types.

invalid_cast_method

The method tear-off '{0}' has type '{1}' that isn't of expected type '{2}'. This means its parameter or return type doesn't match what is expected.

invalid_cast_new_expr

The constructor returns type '{0}' that isn't of expected type '{1}'.

invalid_code_point

The escape sequence '{0}' isn't a valid code point.

invalid_comment_reference

Comment references should contain a possibly prefixed identifier and can start with 'new', but shouldn't contain anything else.

invalid_constant

Invalid constant value.

invalid_constant_const_prefix

The expression can't be prefixed by 'const' to form a constant pattern.

invalid_constant_pattern_binary

The binary operator {0} is not supported as a constant pattern.

invalid_constant_pattern_duplicate_const

Duplicate 'const' keyword in constant expression.

invalid_constant_pattern_empty_record_literal

The empty record literal is not supported as a constant pattern.

invalid_constant_pattern_generic

This expression is not supported as a constant pattern.

invalid_constant_pattern_negation

Only negation of a numeric literal is supported as a constant pattern.

invalid_constant_pattern_unary

The unary operator {0} is not supported as a constant pattern.

invalid_constructor_name

The name of a constructor must match the name of the enclosing class.

invalid_dependency

Publishable packages can't have '{0}' dependencies.

Learn more
invalid_exception_value

The method {0} can't have an exceptional return value (the second argument) when the return type of the function is either 'void', 'Handle' or 'Pointer'.

Learn more
invalid_export_of_internal_element

The member '{0}' can't be exported as a part of a package's public API.

Learn more
invalid_export_of_internal_element_indirectly

The member '{0}' can't be exported as a part of a package's public API, but is indirectly exported as part of the signature of '{1}'.

Learn more
invalid_extension_argument_count

Extension overrides must have exactly one argument: the value of 'this' in the extension method.

Learn more
invalid_factory_method_decl

Factory method '{0}' must have a return type.

Learn more
invalid_factory_method_impl

Factory method '{0}' doesn't return a newly allocated object.

Learn more
invalid_factory_name_not_a_class

The name of a factory constructor must be the same as the name of the immediately enclosing class.

Learn more
invalid_field_name

Record field names can't be a dollar sign followed by an integer when the integer is the index of a positional field.

Record field names can't be private.

Record field names can't be the same as a member from 'Object'.

Learn more
invalid_field_type_in_struct

Fields in struct classes can't have the type '{0}'. They can only be declared as 'int', 'double', 'Array', 'Pointer', or subtype of 'Struct' or 'Union'.

Learn more
invalid_generic_function_type

Invalid generic function type.

invalid_hex_escape

An escape sequence starting with '\x' must be followed by 2 hexadecimal digits.

invalid_implementation_override

'{1}.{0}' ('{2}') isn't a valid concrete implementation of '{3}.{0}' ('{4}').

The setter '{1}.{0}' ('{2}') isn't a valid concrete implementation of '{3}.{0}' ('{4}').

Learn more
invalid_initializer

Not a valid initializer.

invalid_inline_function_type

Inline function types can't be used for parameters in a generic function type.

Learn more
invalid_inside_unary_pattern

This pattern cannot appear inside a unary pattern (cast pattern, null check pattern, or null assert pattern) without parentheses.

invalid_internal_annotation

Only public elements in a package's private API can be annotated as being internal.

Learn more
invalid_language_version_override

The Dart language version override comment can't be followed by any non-whitespace characters.

The Dart language version override comment must be specified with a version number, like '2.0', after the '=' character.

The Dart language version override comment must be specified with an '=' character.

The Dart language version override comment must be specified with exactly two slashes.

The Dart language version override comment must be specified with the word 'dart' in all lower case.

The Dart language version override number can't be prefixed with a letter.

The Dart language version override number must begin with '@dart'.

The language version override can't specify a version greater than the latest known language version: {0}.{1}.

The language version override must be specified before any declaration or directive.

Learn more
invalid_literal_annotation

Only const constructors can have the @literal annotation.

Learn more
invalid_literal_in_configuration

The literal in a configuration can't contain interpolation.

invalid_modifier_on_constructor

The modifier '{0}' can't be applied to the body of a constructor.

Learn more
invalid_modifier_on_setter

Setters can't use 'async', 'async*', or 'sync*'.

Learn more
invalid_non_virtual_annotation

The annotation '@nonVirtual' can only be applied to a concrete instance member.

Learn more
invalid_null_aware_operator

The element can't be null, so the null-aware operator '?' is unnecessary.

The map entry key can't be null, so the null-aware operator '?' is unnecessary.

The map entry value can't be null, so the null-aware operator '?' is unnecessary.

The receiver can't be 'null' because of short-circuiting, so the null-aware operator '{0}' can't be used.

The receiver can't be null, so the null-aware operator '{0}' is unnecessary.

Learn more
invalid_operator

The string '{0}' isn't a user-definable operator.

invalid_operator_for_super

The operator '{0}' can't be used with 'super'.

invalid_operator_questionmark_period_for_super

The operator '?.' cannot be used with 'super' because 'super' cannot be null.

invalid_option

Invalid option specified for '{0}': {1}

invalid_override

'{1}.{0}' ('{2}') isn't a valid override of '{3}.{0}' ('{4}').

The setter '{1}.{0}' ('{2}') isn't a valid override of '{3}.{0}' ('{4}').

Learn more
invalid_override_of_non_virtual_member

The member '{0}' is declared non-virtual in '{1}' and can't be overridden in subclasses.

Learn more
invalid_pattern_variable_in_shared_case_scope

The variable '{0}' doesn't have the same type and/or finality in all cases that share this body.

The variable '{0}' is available in some, but not all cases that share this body.

The variable '{0}' is not available because there is a label or 'default' case.

Learn more
invalid_platforms_field

The 'platforms' field must be a map with platforms as keys.

Learn more
invalid_reference_to_generative_enum_constructor

Generative enum constructors can only be used as targets of redirection.

Learn more
invalid_reference_to_this

Invalid reference to 'this' expression.

Learn more
invalid_reopen_annotation

The annotation '@reopen' can only be applied to a class that opens capabilities that the supertype intentionally disallows.

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

Incorrect use of the annotation @required on the optional positional parameter '{0}'. Optional positional parameters cannot be required.

invalid_required_positional_param

Redundant use of the annotation @required on the required positional parameter '{0}'.

invalid_return_type_for_catch_error

A value of type '{0}' can't be returned by the 'onError' handler because it must be assignable to '{1}'.

The return type '{0}' isn't assignable to '{1}', as required by 'Future.catchError'.

Learn more
invalid_sealed_annotation

The annotation '@sealed' can only be applied to classes.

Learn more
invalid_section_format

Invalid format for the '{0}' section.

invalid_star_after_async

The modifier 'async*' isn't allowed for an expression function body.

invalid_super_formal_parameter_location

Super parameters can only be used in non-redirecting generative constructors.

Learn more
invalid_super_in_initializer

Can only use 'super' in an initializer for calling the superclass constructor (e.g. 'super()' or 'super.namedConstructor()')

invalid_sync

The modifier 'sync' isn't allowed for an expression function body.

invalid_this_in_initializer

Can only use 'this' in an initializer for field initialization (e.g. 'this.x = something') and constructor redirection (e.g. 'this()' or 'this.namedConstructor())

invalid_type_argument_in_const_literal

Constant list literals can't use a type parameter in a type argument, such as '{0}'.

Constant map literals can't use a type parameter in a type argument, such as '{0}'.

Constant set literals can't use a type parameter in a type argument, such as '{0}'.

Learn more
invalid_unicode_escape_started

The string '' can't stand alone.

invalid_unicode_escape_u_bracket

An escape sequence starting with '\u{' must be followed by 1 to 6 hexadecimal digits followed by a '}'.

invalid_unicode_escape_u_no_bracket

An escape sequence starting with '\u' must be followed by 4 hexadecimal digits.

invalid_unicode_escape_u_started

An escape sequence starting with '\u' must be followed by 4 hexadecimal digits or from 1 to 6 digits between '{' and '}'.

invalid_uri

Invalid URI syntax: '{0}'.

Learn more
invalid_use_of_covariant

The 'covariant' keyword can only be used for parameters in instance methods or before non-final instance fields.

invalid_use_of_covariant_in_extension

Can't have modifier '{0}' in an extension.

Learn more
invalid_use_of_do_not_submit_member

Uses of '{0}' should not be submitted to source control.

Learn more
invalid_use_of_identifier_augmented

The identifier 'augmented' can only be used to reference the augmented declaration inside an augmentation.

invalid_use_of_internal_member

The member '{0}' can only be used within its package.

Learn more
invalid_use_of_null_value

An expression whose value is always 'null' can't be dereferenced.

Learn more
invalid_use_of_protected_member

The member '{0}' can only be used within instance members of subclasses of '{1}'.

invalid_use_of_type_outside_library

The class '{0}' can't be extended outside of its library because it's a final class.

The class '{0}' can't be extended outside of its library because it's an interface class.

The class '{0}' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.

The class '{0}' can't be implemented outside of its library because it's a base class.

The class '{0}' can't be implemented outside of its library because it's a final class.

The class '{0}' can't be used as a mixin superclass constraint outside of its library because it's a final class.

The mixin '{0}' can't be implemented outside of its library because it's a base mixin.

Learn more
invalid_use_of_visible_for_overriding_member

The member '{0}' can only be used for overriding.

Learn more
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

The member '{0}' can only be used within '{1}' or a test.

Learn more
invalid_visibility_annotation

The member '{0}' is annotated with '{1}', but this annotation is only meaningful on declarations of public members.

Learn more
invalid_visible_for_overriding_annotation

The annotation 'visibleForOverriding' can only be applied to a public instance member that can be overridden.

Learn more
invalid_visible_outside_template_annotation

The annotation 'visibleOutsideTemplate' can only be applied to a member of a class, enum, or mixin that is annotated with 'visibleForTemplate'.

Learn more
invalid_widget_preview_application

The '@Preview(...)' annotation can only be applied to public, statically accessible constructors and functions.

Learn more
invalid_widget_preview_private_argument

'@Preview(...)' can only accept arguments that consist of literals and public symbols.

Learn more
invocation_of_extension_without_call

The extension '{0}' doesn't define a 'call' method so the override can't be used in an invocation.

Learn more
invocation_of_non_function

'{0}' isn't a function.

Learn more
invocation_of_non_function_expression

The expression doesn't evaluate to a function, so it can't be invoked.

Learn more
label_in_outer_scope

Can't reference label '{0}' declared in an outer method.

Learn more
label_undefined

Can't reference an undefined label '{0}'.

Learn more
late_final_field_with_const_constructor

Can't have a late final field in a class with a generative const constructor.

Learn more
late_final_local_already_assigned

The late final local variable is already assigned.

Learn more
late_pattern_variable_declaration

A pattern variable declaration may not use the late keyword.

leaf_call_must_not_return_handle

FFI leaf call can't return a 'Handle'.

Learn more
leaf_call_must_not_take_handle

FFI leaf call can't take arguments of type 'Handle'.

Learn more
library_directive_not_first

The library directive must appear before all other directives.

list_element_type_not_assignable

The element type '{0}' can't be assigned to the list type '{1}'.

Learn more
literal_with_class

A {0} literal can't be prefixed by '{1}'.

literal_with_class_and_new

A {0} literal can't be prefixed by 'new {1}'.

literal_with_new

A literal can't be prefixed by 'new'.

local_function_declaration_modifier

Local function declarations can't specify any modifiers.

main_first_positional_parameter_type

The type of the first positional parameter of the 'main' function must be a supertype of 'List'.

Learn more
main_has_required_named_parameters

The function 'main' can't have any required named parameters.

Learn more
main_has_too_many_required_positional_parameters

The function 'main' can't have more than two required positional parameters.

Learn more
main_is_not_function

The declaration named 'main' must be a function.

Learn more
map_entry_not_in_map

Map entries can only be used in a map literal.

Learn more
map_key_type_not_assignable

The element type '{0}' can't be assigned to the map key type '{1}'.

Learn more
map_value_type_not_assignable

The element type '{0}' can't be assigned to the map value type '{1}'.

Learn more
member_with_class_name

A class member can't have the same name as the enclosing class.

mismatched_annotation_on_struct_field

The annotation doesn't match the declared type of the field.

Learn more
missing_annotation_on_struct_field

Fields of type '{0}' in a subclass of '{1}' must have an annotation indicating the native type.

Learn more
missing_assignable_selector

Missing selector such as '.identifier' or '[0]'.

missing_assignment_in_initializer

Expected an assignment after the field name.

missing_catch_or_finally

A try block must be followed by an 'on', 'catch', or 'finally' clause.

missing_closing_parenthesis

The closing parenthesis is missing.

missing_const_final_var_or_type

Variables must be declared using the keywords 'const', 'final', 'var' or a type name.

missing_const_in_list_literal

Seeing this message constitutes a bug. Please report it.

missing_const_in_map_literal

Seeing this message constitutes a bug. Please report it.

missing_const_in_set_literal

Seeing this message constitutes a bug. Please report it.

missing_dart_library

Required library '{0}' is missing.

Learn more
missing_default_value_for_parameter

The parameter '{0}' can't have a value of 'null' because of its type, but the implicit default value is 'null'.

With null safety, use the 'required' keyword, not the '@required' annotation.

Learn more
missing_dependency

Missing a dependency on imported package '{0}'.

Learn more
missing_enum_body

An enum definition must have a body with at least one constant name.

missing_enum_constant_in_switch

Missing case clause for '{0}'.

Learn more
missing_exception_value

The method {0} must have an exceptional return value (the second argument) when the return type of the function is neither 'void', 'Handle', nor 'Pointer'.

Learn more
missing_expression_in_initializer

Expected an expression after the assignment operator.

missing_expression_in_throw

Missing expression after 'throw'.

missing_field_type_in_struct

Fields in struct classes must have an explicitly declared type of 'int', 'double' or 'Pointer'.

Learn more
missing_function_body

A function body must be provided.

missing_function_keyword

Function types must have the keyword 'Function' before the parameter list.

missing_function_parameters

Functions must have an explicit list of parameters.

missing_get

Getters must have the keyword 'get' before the getter name.

missing_identifier

Expected an identifier.

missing_initializer

Expected an initializer.

missing_keyword_operator

Operator declarations must be preceded by the keyword 'operator'.

missing_method_parameters

Methods must have an explicit list of parameters.

missing_name

The 'name' field is required but missing.

Learn more
missing_named_pattern_field_name

The getter name is not specified explicitly, and the pattern is not a variable.

Learn more
missing_name_for_named_parameter

Named parameters in a function type must have a name

missing_name_in_library_directive

Library directives must include a library name.

missing_name_in_part_of_directive

Part-of directives must include a library name.

missing_override_of_must_be_overridden

Missing concrete implementation of '{0}'.

Missing concrete implementations of '{0}' and '{1}'.

Missing concrete implementations of '{0}', '{1}', and {2} more.

Learn more
missing_prefix_in_deferred_import

Deferred imports should have a prefix.

missing_primary_constructor

An extension type declaration must have a primary constructor declaration.

missing_primary_constructor_parameters

A primary constructor declaration must have formal parameters.

missing_required_argument

The named parameter '{0}' is required, but there's no corresponding argument.

Learn more
missing_required_param

The parameter '{0}' is required.

The parameter '{0}' is required. {1}.

Learn more
missing_return

This function has a return type of '{0}', but doesn't end with a return statement.

Learn more
missing_size_annotation_carray

Fields of type 'Array' must have exactly one 'Array' annotation.

Learn more
missing_star_after_sync

The modifier 'sync' must be followed by a star ('*').

missing_statement

Expected a statement.

missing_terminator_for_parameter_group

There is no '{0}' to close the parameter group.

missing_typedef_parameters

Typedefs must have an explicit list of parameters.

missing_variable_in_for_each

A loop variable must be declared in a for-each loop before the 'in', but none was found.

missing_variable_pattern

Variable pattern '{0}' is missing in this branch of the logical-or pattern.

Learn more
mixed_parameter_groups

Can't have both positional and named parameters in a single parameter list.

mixin_application_concrete_super_invoked_member_type

The super-invoked member '{0}' has the type '{1}', and the concrete member in the class has the type '{2}'.

Learn more
mixin_application_not_implemented_interface

'{0}' can't be mixed onto '{1}' because '{1}' doesn't implement '{2}'.

Learn more
mixin_application_no_concrete_super_invoked_member

The class doesn't have a concrete implementation of the super-invoked member '{0}'.

The class doesn't have a concrete implementation of the super-invoked setter '{0}'.

Learn more
mixin_class_declaration_extends_not_object

The class '{0}' can't be declared a mixin because it extends a class other than 'Object'.

Learn more
mixin_class_declares_constructor

The class '{0}' can't be used as a mixin because it declares a constructor.

Learn more
mixin_declares_constructor

Mixins can't declare constructors.

mixin_inherits_from_not_object

The class '{0}' can't be used as a mixin because it extends a class other than 'Object'.

Learn more
mixin_instantiate

Mixins can't be instantiated.

Learn more
mixin_of_non_class

Classes can only mix in mixins and classes.

Learn more
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}' as a superclass.

Learn more
mixin_super_class_constraint_deferred_class

Deferred classes can't be used as superclass constraints.

Learn more
mixin_super_class_constraint_non_interface

Only classes and mixins can be used as superclass constraints.

Learn more
mixin_with_clause

A mixin can't have a with clause.

mixin_with_non_class_superclass

Mixin can only be applied to class.

modifier_out_of_order

The modifier '{0}' should be before the modifier '{1}'.

multiple_clauses

Each '{0}' definition can have at most one '{1}' clause.

multiple_combinators

Using multiple 'hide' or 'show' combinators is never necessary and often produces surprising results.

Learn more
multiple_extends_clauses

Each class definition can have at most one extends clause.

multiple_implements_clauses

Each class or mixin definition can have at most one implements clause.

multiple_library_directives

Only one library directive may be declared in a file.

multiple_named_parameter_groups

Can't have multiple groups of named parameters in a single parameter list.

multiple_on_clauses

Each mixin definition can have at most one on clause.

multiple_part_of_directives

Only one part-of directive may be declared in a file.

multiple_plugins

Multiple plugins can't be enabled.

multiple_positional_parameter_groups

Can't have multiple groups of positional parameters in a single parameter list.

multiple_redirecting_constructor_invocations

Constructors can have only one 'this' redirection, at most.

Learn more
multiple_representation_fields

Each extension type should have exactly one representation field.

multiple_super_initializers

A constructor can have at most one 'super' initializer.

Learn more
multiple_variables_in_for_each

A single loop variable must be declared in a for-each loop before the 'in', but {0} were found.

multiple_variance_modifiers

Each type parameter can have at most one variance modifier.

multiple_with_clauses

Each class definition can have at most one with clause.

must_be_a_native_function_type

The type '{0}' given to '{1}' must be a valid 'dart:ffi' native function type.

Learn more
must_be_a_subtype

The type '{0}' must be a subtype of '{1}' for '{2}'.

Learn more
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: {0}

Learn more
must_call_super

This method overrides a method annotated as '@mustCallSuper' in '{0}', but doesn't invoke the overridden method.

Learn more
must_return_void

The return type of the function passed to 'NativeCallable.listener' must be 'void' rather than '{0}'.

Learn more
named_function_expression

Function expressions can't be named.

named_function_type

Function types can't be named.

named_parameter_outside_group

Named parameters must be enclosed in curly braces ('{' and '}').

name_not_string

The value of the 'name' field is required to be a string.

Learn more
native_clause_in_non_sdk_code

Native clause can only be used in the SDK and code that is loaded through native extensions.

native_clause_should_be_annotation

Native clause in this form is deprecated.

native_field_invalid_type

'{0}' is an unsupported type for native fields. Native fields only support pointers, arrays or numeric and compound types.

Learn more
native_field_missing_type

The native type of this field could not be inferred and must be specified in the annotation.

Learn more
native_field_not_static

Native fields must be static.

Learn more
native_function_body_in_non_sdk_code

Native functions can only be declared in the SDK and code that is loaded through native extensions.

native_function_missing_type

The native type of this function couldn't be inferred so it must be specified in the annotation.

Learn more
negative_variable_dimension

The variable dimension of a variable-length array must be non-negative.

Learn more
new_with_undefined_constructor

The class '{0}' doesn't have a constructor named '{1}'.

new_with_undefined_constructor_default

The class '{0}' doesn't have an unnamed constructor.

Learn more
non_abstract_class_inherits_abstract_member

Missing concrete implementation of '{0}'.

Missing concrete implementations of '{0}' and '{1}'.

Missing concrete implementations of '{0}', '{1}', '{2}', '{3}', and {4} more.

Missing concrete implementations of '{0}', '{1}', '{2}', and '{3}'.

Missing concrete implementations of '{0}', '{1}', and '{2}'.

Learn more
non_bool_condition

Conditions must have a static type of 'bool'.

Learn more
non_bool_expression

The expression in an assert must be of type 'bool'.

Learn more
non_bool_negation_expression

A negation operand must have a static type of 'bool'.

Learn more
non_bool_operand

The operands of the operator '{0}' must be assignable to 'bool'.

Learn more
non_constant_annotation_constructor

Annotation creation can only call a const constructor.

Learn more
non_constant_case_expression

Case expressions must be constant.

Learn more
non_constant_case_expression_from_deferred_library

Constant values from a deferred library can't be used as a case expression.

Learn more
non_constant_default_value

The default value of an optional parameter must be constant.

Learn more
non_constant_default_value_from_deferred_library

Constant values from a deferred library can't be used as a default parameter value.

Learn more
non_constant_list_element

The values in a const list literal must be constants.

Learn more
non_constant_map_element

The elements in a const map literal must be constant.

Learn more
non_constant_map_key

The keys in a const map literal must be constant.

Learn more
non_constant_map_pattern_key

Key expressions in map patterns must be constants.

Learn more
non_constant_map_value

The values in a const map literal must be constant.

Learn more
non_constant_record_field

The fields in a const record literal must be constants.

non_constant_record_field_from_deferred_library

Constant values from a deferred library can't be used as fields in a 'const' record literal.

non_constant_relational_pattern_expression

The relational pattern expression must be a constant.

Learn more
non_constant_set_element

The values in a const set literal must be constants.

Learn more
non_constant_type_argument

The type arguments to '{0}' must be known at compile time, so they can't be type parameters.

Learn more
non_constructor_factory

Only a constructor can be declared to be a factory.

non_const_argument_for_const_parameter

Argument '{0}' must be a constant.

Learn more
non_const_call_to_literal_constructor

This instance creation must be 'const', because the {0} constructor is marked as '@literal'.

Learn more
non_const_generative_enum_constructor

Generative enum constructors must be 'const'.

Learn more
non_const_map_as_expression_statement

A non-constant map or set literal without type arguments can't be used as an expression statement.

non_covariant_type_parameter_position_in_representation_type

An extension type parameter can't be used in a non-covariant position of its representation type.

Learn more
non_exhaustive_switch_expression

The type '{0}' is not exhaustively matched by the switch cases since it doesn't match '{1}'.

Learn more
non_exhaustive_switch_statement

The type '{0}' is not exhaustively matched by the switch cases since it doesn't match '{1}'.

Learn more
non_final_field_in_enum

Enums can only declare final fields.

Learn more
non_generative_constructor

The generative constructor '{0}' is expected, but a factory was found.

Learn more
non_generative_implicit_constructor

The unnamed constructor of superclass '{0}' (called by the default constructor of '{1}') must be a generative constructor, but factory found.

Learn more
non_identifier_library_name

The name of a library must be an identifier.

non_native_function_type_argument_to_pointer

Can't invoke 'asFunction' because the function signature '{0}' for the pointer isn't a valid C function signature.

Learn more
non_nullable_equals_parameter

The parameter type of '==' operators should be non-nullable.

non_part_of_directive_in_part

The part-of directive must be the only directive in a part.

non_positive_array_dimension

Array dimensions must be positive numbers.

Learn more
non_resizable_activity

The <activity> element should be allowed to be resized to allow users to take advantage of the multi-window environment on Chrome OS

non_sized_type_argument

The type '{1}' isn't a valid type argument for '{0}'. The type argument must be a native integer, 'Float', 'Double', 'Pointer', or subtype of 'Struct', 'Union', or 'AbiSpecificInteger'.

Learn more
non_string_literal_as_uri

The URI must be a string literal.

non_sync_factory

Factory bodies can't use 'async', 'async*', or 'sync*'.

Learn more
non_type_as_type_argument

The name '{0}' isn't a type, so it can't be used as a type argument.

Learn more
non_type_in_catch_clause

The name '{0}' isn't a type and can't be used in an on-catch clause.

Learn more
non_user_definable_operator

The operator '{0}' isn't user definable.

non_void_return_for_operator

The return type of the operator []= must be 'void'.

Learn more
non_void_return_for_setter

The return type of the setter must be 'void' or absent.

Learn more
normal_before_optional_parameters

Normal parameters must occur before optional parameters.

not_assigned_potentially_non_nullable_local_variable

The non-nullable local variable '{0}' must be assigned before it can be used.

Learn more
not_a_type

{0} isn't a type.

Learn more
not_binary_operator

'{0}' isn't a binary operator.

Learn more
not_enough_positional_arguments

1 positional argument expected by '{0}', but 0 found.

1 positional argument expected, but 0 found.

{0} positional arguments expected by '{2}', but {1} found.

{0} positional arguments expected, but {1} found.

Learn more
not_initialized_non_nullable_instance_field

Non-nullable instance field '{0}' must be initialized.

Learn more
not_initialized_non_nullable_variable

The non-nullable variable '{0}' must be initialized.

Learn more
not_instantiated_bound

Type parameter bound types must be instantiated.

not_iterable_spread

Spread elements in list or set literals must implement 'Iterable'.

Learn more
not_map_spread

Spread elements in map literals must implement 'Map'.

Learn more
not_null_aware_null_spread

The Null-typed expression can't be used with a non-null-aware spread.

no_annotation_constructor_arguments

Annotation creation must have arguments.

Learn more
no_combined_super_signature

Can't infer missing types in '{0}' from overridden methods: {1}.

Learn more
no_default_super_constructor

The superclass '{0}' doesn't have a zero argument constructor.

no_generative_constructors_in_superclass

The class '{0}' can't extend '{1}' because '{1}' only has factory constructors (no generative constructors), and '{0}' has at least one generative constructor.

Learn more
no_touchscreen_feature

The default "android.hardware.touchscreen" needs to be optional for Chrome OS.

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.

Learn more
nullable_type_in_extends_clause

A class can't extend a nullable type.

Learn more
nullable_type_in_implements_clause

A class, mixin, or extension type can't implement a nullable type.

Learn more
nullable_type_in_on_clause

A mixin can't have a nullable type as a superclass constraint.

Learn more
nullable_type_in_with_clause

A class or mixin can't mix in a nullable type.

Learn more
null_argument_to_non_null_type

'{0}' shouldn't be called with a 'null' argument for the non-nullable type argument '{1}'.

Learn more
null_aware_cascade_out_of_order

The '?..' cascade operator must be first in the cascade sequence.

null_check_always_fails

This null-check will always throw an exception because the expression will always evaluate to 'null'.

Learn more
object_cannot_extend_another_class

The class 'Object' can't extend any other class.

obsolete_colon_for_default_value

Using a colon as the separator before a default value is no longer supported.

Learn more
on_repeated

The type '{0}' can be included in the superclass constraints only once.

Learn more
optional_parameter_in_operator

Optional parameters aren't allowed when defining an operator.

Learn more
out_of_order_clauses

The '{0}' clause must come before the '{1}' clause.

override_on_non_overriding_member

The field doesn't override an inherited getter or setter.

The getter doesn't override an inherited getter.

The method doesn't override an inherited method.

The setter doesn't override an inherited setter.

Learn more
packed_annotation

Structs must have at most one 'Packed' annotation.

Learn more
packed_annotation_alignment

Only packing to 1, 2, 4, 8, and 16 bytes is supported.

Learn more
parse_error

{0}

part_of_different_library

Expected this library to be part of '{0}', not '{1}'.

Learn more
part_of_name

The 'part of' directive can't use a name with the enhanced-parts feature.

part_of_non_part

The included part '{0}' must have a part-of directive.

Learn more
part_of_unnamed_library

The library is unnamed. A URI is expected, not a library name '{0}', in the part-of directive.

Learn more
path_does_not_exist

The path '{0}' doesn't exist.

Learn more
path_not_posix

The path '{0}' isn't a POSIX-style path.

Learn more
path_pubspec_does_not_exist

The directory '{0}' doesn't contain a pubspec.

Learn more
pattern_assignment_declares_variable

Variable '{0}' can't be declared in a pattern assignment.

pattern_assignment_not_local_variable

Only local variables can be assigned in pattern assignments.

Learn more
pattern_constant_from_deferred_library

Constant values from a deferred library can't be used in patterns.

Learn more
pattern_never_matches_value_type

The matched value type '{0}' can never match the required type '{1}'.

pattern_type_mismatch_in_irrefutable_context

The matched value of type '{0}' isn't assignable to the required type '{1}'.

Learn more
pattern_variable_assignment_inside_guard

Pattern variables can't be assigned inside the guard of the enclosing guarded pattern.

Learn more
pattern_variable_declaration_outside_function_or_method

A pattern variable declaration may not appear outside a function or method.

permission_implies_unsupported_hardware

Permission makes app incompatible for Chrome OS, consider adding optional {0} feature tag,

platform_value_disallowed

Keys in the platforms field can't have values.

Learn more
positional_after_named_argument

Positional arguments must occur before named arguments.

positional_field_in_object_pattern

Object patterns can only use named fields.

Learn more
positional_parameter_outside_group

Positional parameters must be enclosed in square brackets ('[' and ']').

positional_super_formal_parameter_with_positional_argument

Positional super parameters can't be used when the super constructor invocation has a positional argument.

Learn more
prefix_after_combinator

The prefix ('as' clause) should come before any show/hide combinators.

prefix_collides_with_top_level_member

The name '{0}' is already used as an import prefix and can't be used to name a top-level element.

Learn more
prefix_identifier_not_followed_by_dot

The name '{0}' refers to an import prefix, so it must be followed by '.'.

Learn more
prefix_shadowed_by_local_declaration

The prefix '{0}' can't be used here because it's shadowed by a local declaration.

Learn more
private_collision_in_mixin_application

The private name '{0}', defined by '{1}', conflicts with the same name defined by '{2}'.

Learn more
private_optional_parameter

Named parameters can't start with an underscore.

Learn more
private_setter

The setter '{0}' is private and can't be accessed outside the library that declares it.

Learn more
read_potentially_unassigned_final

The final variable '{0}' can't be read because it's potentially unassigned at this point.

Learn more
receiver_of_type_never

The receiver is of type 'Never', and will never complete with a value.

record_literal_one_positional_no_trailing_comma

A record literal with exactly one positional field requires a trailing comma.

Learn more
record_type_one_positional_no_trailing_comma

A record type with exactly one positional field requires a trailing comma.

Learn more
recursive_compile_time_constant

The compile-time constant expression depends on itself.

Learn more
recursive_constant_constructor

The constant constructor depends on itself.

recursive_constructor_redirect

Constructors can't redirect to themselves either directly or indirectly.

Learn more
recursive_include_file

The include file '{0}' in '{1}' includes itself recursively.

recursive_interface_inheritance

'{0}' can't be a superinterface of itself: {1}.

'{0}' can't extend itself.

'{0}' can't implement itself.

'{0}' can't use itself as a mixin.

'{0}' can't use itself as a superclass constraint.

Learn more
redeclare_on_non_redeclaring_member

The {0} doesn't redeclare a {0} declared in a superinterface.

Learn more
redirecting_constructor_with_body

Redirecting constructors can't have a body.

redirection_in_non_factory_constructor

Only factory constructor can specify '=' redirection.

redirect_generative_to_missing_constructor

The constructor '{0}' couldn't be found in '{1}'.

Learn more
redirect_generative_to_non_generative_constructor

Generative constructors can't redirect to a factory constructor.

Learn more
redirect_to_abstract_class_constructor

The redirecting constructor '{0}' can't redirect to a constructor of the abstract class '{1}'.

Learn more
redirect_to_invalid_function_type

The redirected constructor '{0}' has incompatible parameters with '{1}'.

Learn more
redirect_to_invalid_return_type

The return type '{0}' of the redirected constructor isn't a subtype of '{1}'.

Learn more
redirect_to_missing_constructor

The constructor '{0}' couldn't be found in '{1}'.

Learn more
redirect_to_non_class

The name '{0}' isn't a type and can't be used in a redirected constructor.

Learn more
redirect_to_non_const_constructor

A constant redirecting constructor can't redirect to a non-constant constructor.

Learn more
redirect_to_type_alias_expands_to_type_parameter

A redirecting constructor can't redirect to a type alias that expands to a type parameter.

Learn more
referenced_before_declaration

Local variable '{0}' can't be referenced before it is declared.

Learn more
refutable_pattern_in_irrefutable_context

Refutable patterns can't be used in an irrefutable context.

Learn more
relational_pattern_operand_type_not_assignable

The constant expression type '{0}' is not assignable to the parameter type '{1}' of the '{2}' operator.

Learn more
relational_pattern_operator_return_type_not_assignable_to_bool

The return type of operators used in relational patterns must be assignable to 'bool'.

Learn more
removed_lint

'{0}' was removed in Dart '{1}'

removed_lint_use

'{0}' was removed in Dart '{1}'

replaced_lint

'{0}' was replaced by '{2}' in Dart '{1}'.

replaced_lint_use

'{0}' was replaced by '{2}' in Dart '{1}'.

representation_field_modifier

Representation fields can't have modifiers.

representation_field_trailing_comma

The representation field can't have a trailing comma.

rest_element_in_map_pattern

A map pattern can't contain a rest pattern.

Learn more
rethrow_outside_catch

A rethrow must be inside of a catch clause.

Learn more
return_in_generative_constructor

Constructors can't return values.

Learn more
return_in_generator

Can't return a value from a generator function that uses the 'async*' or 'sync*' modifier.

Learn more
return_of_do_not_store

'{0}' is annotated with 'doNotStore' and shouldn't be returned unless '{1}' is also annotated.

Learn more
return_of_invalid_type

A value of type '{0}' can't be returned from the constructor '{2}' because it has a return type of '{1}'.

A value of type '{0}' can't be returned from the function '{2}' because it has a return type of '{1}'.

A value of type '{0}' can't be returned from the method '{2}' because it has a return type of '{1}'.

Learn more
return_of_invalid_type_from_closure

The returned type '{0}' isn't returnable from a '{1}' function, as required by the closure's context.

Learn more
return_without_value

The return value is missing after 'return'.

Learn more
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 run on earlier versions.

Learn more
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 to be able to run on earlier versions.

Learn more
sdk_version_bool_operator_in_const_context

The use of the operator '{0}' for 'bool' operands in a constant context wasn't supported until version 2.3.2, but this code is required to be able to run on earlier versions.

Learn more
sdk_version_constructor_tearoffs

Tearing off a constructor requires the 'constructor-tearoffs' language feature.

Learn more
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 required to be able to run on earlier versions.

Learn more
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.

Learn more
sdk_version_gt_gt_gt_operator

The operator '>>>' wasn't supported until version 2.14.0, but this code is required to be able to run on earlier versions.

Learn more
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 be able to run on earlier versions.

Learn more
sdk_version_never

The type 'Never' wasn't supported until version 2.12.0, but this code is required to be able to run on earlier versions.

Learn more
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.

Learn more
sdk_version_since

This API is available since SDK {0}, but constraints '{1}' don't guarantee it.

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.

Learn more
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 be able to run on earlier versions.

Learn more
sealed_enum

Enums can't be declared to be 'sealed'.

sealed_mixin

A mixin can't be declared 'sealed'.

sealed_mixin_class

A mixin class can't be declared 'sealed'.

setter_constructor

Constructors can't be a setter.

setter_in_function

Setters can't be defined within methods or functions.

setting_orientation_on_activity

The <activity> element should not be locked to any orientation so that users can take advantage of the multi-window environments and larger screens on Chrome OS

set_element_type_not_assignable

The element type '{0}' can't be assigned to the set type '{1}'.

Learn more
shared_deferred_prefix

The prefix of a deferred import can't be used in other import directives.

Learn more
size_annotation_dimensions

'Array's must have an 'Array' annotation that matches the dimensions.

Learn more
spread_expression_from_deferred_library

Constant values from a deferred library can't be spread into a const literal.

stack_overflow

The file has too many nested expressions or statements.

static_access_to_instance_member

Instance member '{0}' can't be accessed using static access.

Learn more
static_constructor

Constructors can't be static.

static_getter_without_body

A 'static' getter must have a body.

static_operator

Operators can't be static.

static_setter_without_body

A 'static' setter must have a body.

strict_raw_type

The generic type '{0}' should have explicit type arguments but doesn't.

subtype_of_base_or_final_is_not_base_final_or_sealed

The mixin '{0}' must be 'base' because the supertype '{1}' is 'base'.

The mixin '{0}' must be 'base' because the supertype '{1}' is 'final'.

The type '{0}' must be 'base', 'final' or 'sealed' because the supertype '{1}' is 'base'.

The type '{0}' must be 'base', 'final' or 'sealed' because the supertype '{1}' is 'final'.

Learn more
subtype_of_deferred_class

Classes and mixins can't implement deferred classes.

Classes can't extend deferred classes.

Classes can't mixin deferred classes.

Learn more
subtype_of_disallowed_type

'{0}' can't be used as a superclass constraint.

Classes and mixins can't implement '{0}'.

Classes can't extend '{0}'.

Classes can't mixin '{0}'.

Learn more
subtype_of_ffi_class

The class '{0}' can't extend '{1}'.

The class '{0}' can't implement '{1}'.

The class '{0}' can't mix in '{1}'.

Learn more
subtype_of_sealed_class

The class '{0}' shouldn't be extended, mixed in, or implemented because it's sealed.

Learn more
subtype_of_struct_class

The class '{0}' can't extend '{1}' because '{1}' is a subtype of 'Struct', 'Union', or 'AbiSpecificInteger'.

The class '{0}' can't implement '{1}' because '{1}' is a subtype of 'Struct', 'Union', or 'AbiSpecificInteger'.

The class '{0}' can't mix in '{1}' because '{1}' is a subtype of 'Struct', 'Union', or 'AbiSpecificInteger'.

Learn more
supertype_expands_to_type_parameter

A type alias that expands to a type parameter can't be implemented.

A type alias that expands to a type parameter can't be mixed in.

A type alias that expands to a type parameter can't be used as a superclass constraint.

A type alias that expands to a type parameter can't be used as a superclass.

Learn more
super_formal_parameter_type_is_not_subtype_of_associated

The type '{0}' of this parameter isn't a subtype of the type '{1}' of the associated super constructor parameter.

Learn more
super_formal_parameter_without_associated_named

No associated named super constructor parameter.

Learn more
super_formal_parameter_without_associated_positional

No associated positional super constructor parameter.

Learn more
super_initializer_in_object

The class 'Object' can't invoke a constructor from a superclass.

super_invocation_not_last

The superconstructor call must be last in an initializer list: '{0}'.

Learn more
super_in_enum_constructor

The enum constructor can't have a 'super' initializer.

Learn more
super_in_extension

The 'super' keyword can't be used in an extension because an extension doesn't have a superclass.

Learn more
super_in_extension_type

The 'super' keyword can't be used in an extension type because an extension type doesn't have a superclass.

Learn more
super_in_invalid_context

Invalid context for 'super' invocation.

Learn more
super_in_redirecting_constructor

The redirecting constructor can't have a 'super' initializer.

Learn more
switch_case_completes_normally

The 'case' shouldn't complete normally.

Learn more
switch_expression_not_assignable

Type '{0}' of the switch expression isn't assignable to the type '{1}' of case expressions.

Learn more
switch_has_case_after_default_case

The default case should be the last case in a switch statement.

switch_has_multiple_default_cases

The 'default' case can only be declared once.

tearoff_of_generative_constructor_of_abstract_class

A generative constructor of an abstract class can't be torn off.

Learn more
text_direction_code_point_in_comment

The Unicode code point 'U+{0}' changes the appearance of text from how it's interpreted by the compiler.

Learn more
text_direction_code_point_in_literal

The Unicode code point 'U+{0}' changes the appearance of text from how it's interpreted by the compiler.

Learn more
throw_of_invalid_type

The type '{0}' of the thrown expression must be assignable to 'Object'.

Learn more
top_level_cycle

The type of '{0}' can't be inferred because it depends on itself through the cycle: {1}.

Learn more
top_level_operator

Operators must be declared within a class.

typedef_in_class

Typedefs can't be declared inside classes.

type_alias_cannot_reference_itself

Typedefs can't reference themselves directly or recursively via another typedef.

Learn more
type_annotation_deferred_class

The deferred type '{0}' can't be used in a declaration, cast, or type test.

Learn more
type_arguments_on_type_variable

Can't use type arguments with type variable '{0}'.

type_argument_not_matching_bounds

'{0}' doesn't conform to the bound '{2}' of the type parameter '{1}'.

Learn more
type_before_factory

Factory constructors cannot have a return type.

type_check_with_null

Tests for non-null should be done with '!= null'.

Tests for null should be done with '== null'.

Learn more
type_parameter_on_constructor

Constructors can't have type parameters.

type_parameter_on_operator

Types parameters aren't allowed when defining an operator.

type_parameter_referenced_by_static

Static members can't reference type parameters of the class.

Learn more
type_parameter_supertype_of_its_bound

'{0}' can't be a supertype of its upper bound.

Learn more
type_test_with_non_type

The name '{0}' isn't a type and can't be used in an 'is' expression.

Learn more
type_test_with_undefined_name

The name '{0}' isn't defined, so it can't be used in an 'is' expression.

Learn more
unchecked_use_of_nullable_value

A nullable expression can't be used as a condition.

A nullable expression can't be used as an iterator in a for-in loop.

A nullable expression can't be used in a spread.

A nullable expression can't be used in a yield-each statement.

The function can't be unconditionally invoked because it can be 'null'.

The method '{0}' can't be unconditionally invoked because the receiver can be 'null'.

The operator '{0}' can't be unconditionally invoked because the receiver can be 'null'.

The property '{0}' can't be unconditionally accessed because the receiver can be 'null'.

Learn more
undefined_annotation

Undefined name '{0}' used as an annotation.

Learn more
undefined_class

Undefined class '{0}'.

Learn more
undefined_constructor_in_initializer

The class '{0}' doesn't have a constructor named '{1}'.

The class '{0}' doesn't have an unnamed constructor.

Learn more
undefined_enum_constant

There's no constant named '{0}' in '{1}'.

Learn more
undefined_enum_constructor

The enum doesn't have a constructor named '{0}'.

The enum doesn't have an unnamed constructor.

Learn more
undefined_extension_getter

The getter '{0}' isn't defined for the extension '{1}'.

Learn more
undefined_extension_method

The method '{0}' isn't defined for the extension '{1}'.

Learn more
undefined_extension_operator

The operator '{0}' isn't defined for the extension '{1}'.

Learn more
undefined_extension_setter

The setter '{0}' isn't defined for the extension '{1}'.

Learn more
undefined_function

The function '{0}' isn't defined.

Learn more
undefined_getter

The getter '{0}' isn't defined for the '{1}' function type.

The getter '{0}' isn't defined for the type '{1}'.

Learn more
undefined_hidden_name

The library '{0}' doesn't export a member with the hidden name '{1}'.

Learn more
undefined_identifier

Undefined name '{0}'.

Learn more
undefined_identifier_await

Undefined name 'await' in function body not marked with 'async'.

Learn more
undefined_lint

'{0}' is not a recognized lint rule.

undefined_method

The method '{0}' isn't defined for the '{1}' function type.

The method '{0}' isn't defined for the type '{1}'.

Learn more
undefined_named_parameter

The named parameter '{0}' isn't defined.

Learn more
undefined_operator

The operator '{0}' isn't defined for the type '{1}'.

Learn more
undefined_prefixed_name

The name '{0}' is being referenced through the prefix '{1}', but it isn't defined in any of the libraries imported using that prefix.

Learn more
undefined_referenced_parameter

The parameter '{0}' isn't defined by '{1}'.

Learn more
undefined_setter

The setter '{0}' isn't defined for the '{1}' function type.

The setter '{0}' isn't defined for the type '{1}'.

Learn more
undefined_shown_name

The library '{0}' doesn't export a member with the shown name '{1}'.

Learn more
undefined_super_member

The getter '{0}' isn't defined in a superclass of '{1}'.

The method '{0}' isn't defined in a superclass of '{1}'.

The operator '{0}' isn't defined in a superclass of '{1}'.

The setter '{0}' isn't defined in a superclass of '{1}'.

Learn more
unexpected_terminator_for_parameter_group

There is no '{0}' to open a parameter group.

unexpected_token

Unexpected text '{0}'.

unexpected_tokens

Unexpected tokens.

unignorable_ignore

The diagnostic '{0}' can't be ignored.

unknown_platform

The platform '{0}' is not a recognized platform.

Learn more
unnecessary_cast

Unnecessary cast.

Learn more
unnecessary_cast_pattern

Unnecessary cast pattern.

unnecessary_dev_dependency

The dev dependency on {0} is unnecessary because there is also a normal dependency on that package.

Learn more
unnecessary_final

The keyword 'final' isn't necessary because the parameter is implicitly 'final'.

Learn more
unnecessary_import

The import of '{0}' is unnecessary because all of the used elements are also provided by the import of '{1}'.

Learn more
unnecessary_nan_comparison

A double can't equal 'double.nan', so the condition is always 'false'.

A double can't equal 'double.nan', so the condition is always 'true'.

Learn more
unnecessary_non_null_assertion

The '!' will have no effect because the receiver can't be null.

Learn more
unnecessary_no_such_method

Unnecessary 'noSuchMethod' declaration.

Learn more
unnecessary_null_assert_pattern

The null-assert pattern will have no effect because the matched type isn't nullable.

Learn more
unnecessary_null_check_pattern

The null-check pattern will have no effect because the matched type isn't nullable.

Learn more
unnecessary_null_comparison

The operand can't be 'null', so the condition is always 'false'.

The operand can't be 'null', so the condition is always 'true'.

The operand must be 'null', so the condition is always 'false'.

The operand must be 'null', so the condition is always 'true'.

Learn more
unnecessary_question_mark

The '?' is unnecessary because '{0}' is nullable without it.

Learn more
unnecessary_set_literal

Braces unnecessarily wrap this expression in a set literal.

Learn more
unnecessary_type_check

Unnecessary type check; the result is always 'false'.

Unnecessary type check; the result is always 'true'.

Learn more
unnecessary_wildcard_pattern

Unnecessary wildcard pattern.

unqualified_reference_to_non_local_static_member

Static members from supertypes must be qualified by the name of the defining type.

Learn more
unqualified_reference_to_static_member_of_extended_type

Static members from the extended type or one of its superclasses must be qualified by the name of the defining type.

Learn more
unreachable_switch_case

This case is covered by the previous cases.

Learn more
unreachable_switch_default

This default clause is covered by the previous cases.

Learn more
unrecognized_error_code

'{0}' isn't a recognized error code.

unsupported_chrome_os_feature

The feature {0} isn't supported on Chrome OS, consider making it optional.

unsupported_chrome_os_hardware

The feature {0} isn't supported on Chrome OS, consider making it optional.

unsupported_option_without_values

The option '{1}' isn't supported by '{0}'.

unsupported_value

The value '{1}' isn't supported by '{0}'.

unused_catch_clause

The exception variable '{0}' isn't used, so the 'catch' clause can be removed.

Learn more
unused_catch_stack

The stack trace variable '{0}' isn't used and can be removed.

Learn more
unused_element

The declaration '{0}' isn't referenced.

Learn more
unused_element_parameter

A value for optional parameter '{0}' isn't ever given.

Learn more
unused_field

The value of the field '{0}' isn't used.

Learn more
unused_import

Unused import: '{0}'.

Learn more
unused_label

The label '{0}' isn't used.

Learn more
unused_local_variable

The value of the local variable '{0}' isn't used.

Learn more
unused_result

'{0}' should be used. {1}.

The value of '{0}' should be used.

Learn more
unused_shown_name

The name {0} is shown, but isn't used.

Learn more
uri_does_not_exist

Target of URI doesn't exist: '{0}'.

Learn more
uri_does_not_exist_in_doc_import

Target of URI doesn't exist: '{0}'.

Learn more
uri_has_not_been_generated

Target of URI hasn't been generated: '{0}'.

Learn more
uri_with_interpolation

URIs can't use string interpolation.

Learn more
use_of_native_extension

Dart native extensions are deprecated and aren't available in Dart 2.15.

Learn more
use_of_void_result

This expression has a type of 'void' so its value can't be used.

Learn more
values_declaration_in_enum

A member named 'values' can't be declared in an enum.

Learn more
variable_length_array_not_last

Variable length 'Array's must only occur as the last field of Structs.

Learn more
variable_pattern_keyword_in_declaration_context

Variable patterns in declaration context can't specify 'var' or 'final' keyword.

Learn more
variable_type_mismatch

A value of type '{0}' can't be assigned to a const variable of type '{1}'.

Learn more
var_and_type

Variables can't be declared using both 'var' and a type name.

var_as_type_name

The keyword 'var' can't be used as a type name.

var_class

Classes can't be declared to be 'var'.

var_enum

Enums can't be declared to be 'var'.

var_return_type

The return type can't be 'var'.

var_typedef

Typedefs can't be declared to be 'var'.

void_with_type_arguments

Type 'void' can't have type arguments.

with_before_extends

The extends clause must be before the with clause.

workspace_field_not_list

The value of the 'workspace' field is required to be a list of relative file paths.

Learn more
workspace_value_not_string

Workspace entries are required to be directory paths (strings).

Learn more
workspace_value_not_subdirectory

Workspace values must be a relative path of a subdirectory of '{0}'.

Learn more
wrong_explicit_type_parameter_variance_in_superinterface

'{0}' is an '{1}' type parameter and can't be used in an '{2}' position in '{3}'.

wrong_number_of_parameters_for_operator

Operator '-' should declare 0 or 1 parameter, but {0} found.

Operator '{0}' should declare exactly {1} parameters, but {2} found.

Learn more
wrong_number_of_parameters_for_setter

Setters must declare exactly one required positional parameter.

Learn more
wrong_number_of_type_arguments

The type '{0}' is declared with {1} type parameters, but {2} type arguments were given.

Learn more
wrong_number_of_type_arguments_constructor

The constructor '{0}.{1}' doesn't have type parameters.

Learn more
wrong_number_of_type_arguments_enum

The enum is declared with {0} type parameters, but {1} type arguments were given.

Learn more
wrong_number_of_type_arguments_extension

The extension '{0}' is declared with {1} type parameters, but {2} type arguments were given.

Learn more
wrong_number_of_type_arguments_function

The function '{0}' is declared with {1} type parameters, but {2} type arguments were given.

This function is declared with {0} type parameters, but {1} type arguments were given.

wrong_number_of_type_arguments_method

The method '{0}' is declared with {1} type parameters, but {2} type arguments are given.

Learn more
wrong_separator_for_positional_parameter

The default value of a positional parameter should be preceded by '='.

wrong_terminator_for_parameter_group

Expected '{0}' to close parameter group.

wrong_type_parameter_variance_in_superinterface

'{0}' can't be used contravariantly or invariantly in '{1}'.

wrong_type_parameter_variance_position

The '{0}' type parameter '{1}' can't be used in an '{2}' position.

yield_in_non_generator

Yield statements must be in a generator function (one marked with either 'async*' or 'sync*').

Yield-each statements must be in a generator function (one marked with either 'async*' or 'sync*').

Learn more
yield_of_invalid_type

A yielded value of type '{0}' must be assignable to '{1}'.

The type '{0}' implied by the 'yield*' expression must be assignable to '{1}'.

Learn more
always_declare_return_types

The function '{0}' should have a return type but doesn't.

The method '{0}' should have a return type but doesn't.

toggle_on
Learn more
always_put_control_body_on_new_line

Statement should be on a separate line.

toggle_on
Learn more
always_put_required_named_parameters_first

Required named parameters should be before optional named parameters.

toggle_on
Learn more
always_require_non_null_named_parameters
toggle_on
always_specify_types

Missing type annotation.

toggle_on
always_use_package_imports

Use 'package:' imports for files in the 'lib' directory.

toggle_on
Learn more
annotate_overrides

The member '{0}' overrides an inherited member but isn't annotated with '@override'.

toggle_on
Learn more
annotate_redeclares

The member '{0}' is redeclaring but isn't annotated with '@redeclare'.

toggle_on
avoid_annotating_with_dynamic

Unnecessary 'dynamic' type annotation.

toggle_on
avoid_as
toggle_on
avoid_bool_literals_in_conditional_expressions

Conditional expressions with a 'bool' literal can be simplified.

toggle_on
avoid_catches_without_on_clauses

Catch clause should use 'on' to specify the type of exception being caught.

toggle_on
avoid_catching_errors

The type 'Error' should not be caught.

The type '{0}' should not be caught because it is a subclass of 'Error'.

toggle_on
avoid_classes_with_only_static_members

Classes should define instance members.

toggle_on
avoid_double_and_int_checks

Explicit check for double or int.

toggle_on
avoid_dynamic_calls

Method invocation or property access on a 'dynamic' target.

toggle_on
Learn more
avoid_empty_else

Empty statements are not allowed in an 'else' clause.

toggle_on
Learn more
avoid_equals_and_hash_code_on_mutable_classes

The method '{0}' should not be overridden in classes not annotated with '@immutable'.

toggle_on
avoid_escaping_inner_quotes

Unnecessary escape of '{0}'.

toggle_on
avoid_field_initializers_in_const_classes

Fields in 'const' classes should not have initializers.

toggle_on
avoid_final_parameters

Parameters should not be marked as 'final'.

toggle_on
avoid_function_literals_in_foreach_calls

Function literals shouldn't be passed to 'forEach'.

toggle_on
Learn more
avoid_futureor_void

Don't use the type 'FutureOr'.

toggle_on
Learn more
avoid_implementing_value_types

Classes that override '==' should not be implemented.

toggle_on
avoid_init_to_null

Redundant initialization to 'null'.

toggle_on
Learn more
avoid_js_rounded_ints

Integer literal can't be represented exactly when compiled to JavaScript.

toggle_on
avoid_multiple_declarations_per_line

Multiple variables declared on a single line.

toggle_on
avoid_null_checks_in_equality_operators

Unnecessary null comparison in implementation of '=='.

toggle_on
avoid_positional_boolean_parameters

'bool' parameters should be named parameters.

toggle_on
avoid_print

Don't invoke 'print' in production code.

toggle_on
Learn more
avoid_private_typedef_functions

The typedef is unnecessary because it is only used in one place.

toggle_on
avoid_redundant_argument_values

The value of the argument is redundant because it matches the default value.

toggle_on
avoid_relative_lib_imports

Can't use a relative path to import a library in 'lib'.

toggle_on
Learn more
avoid_renaming_method_parameters

The parameter name '{0}' doesn't match the name '{1}' in the overridden method.

toggle_on
Learn more
avoid_return_types_on_setters

Unnecessary return type on a setter.

toggle_on
Learn more
avoid_returning_null
toggle_on
avoid_returning_null_for_future
toggle_on
avoid_returning_null_for_void

Don't return 'null' from a function with a return type of 'void'.

Don't return 'null' from a method with a return type of 'void'.

toggle_on
Learn more
avoid_returning_this

Don't return 'this' from a method.

toggle_on
avoid_setters_without_getters

Setter has no corresponding getter.

toggle_on
avoid_shadowing_type_parameters

The type parameter '{0}' shadows a type parameter from the enclosing {1}.

toggle_on
Learn more
avoid_single_cascade_in_expression_statements

Unnecessary cascade expression.

toggle_on
Learn more
avoid_slow_async_io

Use of an async 'dart:io' method.

toggle_on
Learn more
avoid_type_to_string

Using 'toString' on a 'Type' is not safe in production code.

toggle_on
Learn more
avoid_types_as_parameter_names

The parameter name '{0}' matches a visible type name.

The type parameter name '{0}' matches a visible type name.

toggle_on
Learn more
avoid_types_on_closure_parameters

Unnecessary type annotation on a function expression parameter.

toggle_on
avoid_unnecessary_containers

Unnecessary instance of 'Container'.

toggle_on
Learn more
avoid_unstable_final_fields
toggle_on
avoid_unused_constructor_parameters

The parameter '{0}' is not used in the constructor.

toggle_on
avoid_void_async

An 'async' function should have a 'Future' return type when it doesn't return a value.

toggle_on
avoid_web_libraries_in_flutter

Don't use web-only libraries outside Flutter web plugins.

toggle_on
Learn more
await_only_futures

Uses 'await' on an instance of '{0}', which is not a subtype of 'Future'.

toggle_on
Learn more
camel_case_extensions

The extension name '{0}' isn't an UpperCamelCase identifier.

toggle_on
Learn more
camel_case_types

The type name '{0}' isn't an UpperCamelCase identifier.

toggle_on
Learn more
cancel_subscriptions

Uncancelled instance of 'StreamSubscription'.

toggle_on
Learn more
cascade_invocations

Unnecessary duplication of receiver.

toggle_on
cast_nullable_to_non_nullable

Don't cast a nullable value to a non-nullable type.

toggle_on
close_sinks

Unclosed instance of 'Sink'.

toggle_on
Learn more
collection_methods_unrelated_type

The argument type '{0}' isn't related to '{1}'.

toggle_on
Learn more
combinators_ordering

Sort combinator names alphabetically.

toggle_on
comment_references

The referenced name isn't visible in scope.

toggle_on
conditional_uri_does_not_exist

The target of the conditional URI '{0}' doesn't exist.

toggle_on
constant_identifier_names

The constant name '{0}' isn't a lowerCamelCase identifier.

toggle_on
Learn more
control_flow_in_finally

Use of '{0}' in a 'finally' clause.

toggle_on
Learn more
curly_braces_in_flow_control_structures

Statements in {0} should be enclosed in a block.

toggle_on
Learn more
dangling_library_doc_comments

Dangling library doc comment.

toggle_on
Learn more
depend_on_referenced_packages

The imported package '{0}' isn't a dependency of the importing package.

toggle_on
Learn more
deprecated_consistency

Constructors in a deprecated class should be deprecated.

Fields that are initialized by a deprecated parameter should be deprecated.

Parameters that initialize a deprecated field should be deprecated.

toggle_on
deprecated_member_use_from_same_package

'{0}' is deprecated and shouldn't be used.

'{0}' is deprecated and shouldn't be used. {1}

toggle_on
diagnostic_describe_all_properties

The public property isn't described by either 'debugFillProperties' or 'debugDescribeChildren'.

toggle_on
Learn more
directives_ordering

Place 'dart:' {0}s before other {0}s.

Place 'package:' {0}s before relative {0}s.

Sort directive sections alphabetically.

Specify exports in a separate section after all imports.

toggle_on
discarded_futures

'Future'-returning calls in a non-'async' function.

toggle_on
do_not_use_environment

Invalid use of an environment declaration.

toggle_on
document_ignores

Missing documentation explaining why the diagnostic is ignored.

toggle_on
empty_catches

Empty catch block.

toggle_on
Learn more
empty_constructor_bodies

Empty constructor bodies should be written using a ';' rather than '{}'.

toggle_on
Learn more
empty_statements

Unnecessary empty statement.

toggle_on
Learn more
enable_null_safety
toggle_on
eol_at_end_of_file

Missing a newline at the end of the file.

toggle_on
erase_dart_type_extension_types

Unsafe use of 'DartType' in an 'is' check.

exhaustive_cases

Missing case clauses for some constants in '{0}'.

toggle_on
file_names

The file name '{0}' isn't a lower_case_with_underscores identifier.

toggle_on
Learn more
flutter_style_todos

To-do comment doesn't follow the Flutter style.

toggle_on
hash_and_equals

Missing a corresponding override of '{0}'.

toggle_on
Learn more
implementation_imports

Import of a library in the 'lib/src' directory of another package.

toggle_on
Learn more
implicit_call_tearoffs

Implicit tear-off of the 'call' method.

toggle_on
Learn more
implicit_reopen

The {0} '{1}' reopens '{2}' because it is not marked '{3}'.

toggle_on
invalid_case_patterns

This expression is not valid in a 'case' clause in Dart 3.0.

toggle_on
invalid_runtime_check_with_js_interop_types

Cast from '{0}' to '{1}' casts a Dart value to a JS interop type, which might not be platform-consistent.

Cast from '{0}' to '{1}' casts a JS interop value to a Dart type, which might not be platform-consistent.

Cast from '{0}' to '{1}' casts a JS interop value to an incompatible JS interop type, which might not be platform-consistent.

Runtime check between '{0}' and '{1}' checks whether a Dart value is a JS interop type, which might not be platform-consistent.

Runtime check between '{0}' and '{1}' checks whether a JS interop value is a Dart type, which might not be platform-consistent.

Runtime check between '{0}' and '{1}' involves a non-trivial runtime check between two JS interop types that might not be platform-consistent.

Runtime check between '{0}' and '{1}' involves a runtime check between a JS interop value and an unrelated JS interop type that will always be true and won't check the underlying type.

toggle_on
Learn more
invariant_booleans
toggle_on
iterable_contains_unrelated_type
toggle_on
join_return_with_assignment

Assignment could be inlined in 'return' statement.

toggle_on
leading_newlines_in_multiline_strings

Missing a newline at the beginning of a multiline string.

toggle_on
library_annotations

This annotation should be attached to a library directive.

toggle_on
Learn more
library_names

The library name '{0}' isn't a lower_case_with_underscores identifier.

toggle_on
Learn more
library_prefixes

The prefix '{0}' isn't a lower_case_with_underscores identifier.

toggle_on
Learn more
library_private_types_in_public_api

Invalid use of a private type in a public API.

toggle_on
Learn more
lines_longer_than_80_chars

The line length exceeds the 80-character limit.

toggle_on
list_remove_unrelated_type
toggle_on
literal_only_boolean_expressions

The Boolean expression has a constant value.

toggle_on
Learn more
matching_super_parameters

The super parameter named '{0}'' does not share the same name as the corresponding parameter in the super constructor, '{1}'.

toggle_on
missing_code_block_language_in_doc_comment

The code block is missing a specified language.

toggle_on
missing_whitespace_between_adjacent_strings

Missing whitespace between adjacent strings.

toggle_on
Learn more
no_adjacent_strings_in_list

Don't use adjacent strings in a list literal.

toggle_on
Learn more
no_default_cases

Invalid use of 'default' member in a switch.

toggle_on
no_duplicate_case_values

The value of the case clause ('{0}') is equal to the value of an earlier case clause ('{1}').

toggle_on
Learn more
no_leading_underscores_for_library_prefixes

The library prefix '{0}' starts with an underscore.

toggle_on
Learn more
no_leading_underscores_for_local_identifiers

The local variable '{0}' starts with an underscore.

toggle_on
Learn more
no_literal_bool_comparisons

Unnecessary comparison to a boolean literal.

toggle_on
no_logic_in_create_state

Don't put any logic in 'createState'.

toggle_on
Learn more
no_runtimetype_tostring

Using 'toString' on a 'Type' is not safe in production code.

toggle_on
no_self_assignments

The variable or property is being assigned to itself.

toggle_on
no_wildcard_variable_uses

The referenced identifier is a wildcard.

toggle_on
Learn more
non_constant_identifier_names

The variable name '{0}' isn't a lowerCamelCase identifier.

toggle_on
Learn more
noop_primitive_operations

The expression has no effect and can be removed.

toggle_on
null_check_on_nullable_type_parameter

The null check operator shouldn't be used on a variable whose type is a potentially nullable type parameter.

toggle_on
Learn more
null_closures

Closure can't be 'null' because it might be invoked.

toggle_on
omit_local_variable_types

Unnecessary type annotation on a local variable.

toggle_on
omit_obvious_local_variable_types

Omit the type annotation on a local variable when the type is obvious.

toggle_on
omit_obvious_property_types

The type annotation isn't needed because it is obvious.

toggle_on
one_member_abstracts

Unnecessary use of an abstract class.

toggle_on
only_throw_errors

Don't throw instances of classes that don't extend either 'Exception' or 'Error'.

toggle_on
Learn more
overridden_fields

Field overrides a field inherited from '{0}'.

toggle_on
Learn more
package_api_docs

Missing documentation for public API.

toggle_on
package_names

The package name '{0}' isn't a lower_case_with_underscores identifier.

toggle_on
Learn more
package_prefixed_library_names

The library name is not a dot-separated path prefixed by the package name.

toggle_on
Learn more
parameter_assignments

Invalid assignment to the parameter '{0}'.

toggle_on
prefer_adjacent_string_concatenation

String literals shouldn't be concatenated by the '+' operator.

toggle_on
Learn more
prefer_asserts_in_initializer_lists

Assert should be in the initializer list.

toggle_on
Learn more
prefer_asserts_with_message

Missing a message in an assert.

toggle_on
Learn more
prefer_bool_in_asserts
toggle_on
prefer_collection_literals

Unnecessary constructor invocation.

toggle_on
Learn more
prefer_conditional_assignment

The 'if' statement could be replaced by a null-aware assignment.

toggle_on
Learn more
prefer_const_constructors

Use 'const' with the constructor to improve performance.

toggle_on
Learn more
prefer_const_constructors_in_immutables

Constructors in '@immutable' classes should be declared as 'const'.

toggle_on
Learn more
prefer_const_declarations

Use 'const' for final variables initialized to a constant value.

toggle_on
Learn more
prefer_const_literals_to_create_immutables

Use 'const' literals as arguments to constructors of '@immutable' classes.

toggle_on
Learn more
prefer_constructors_over_static_methods

Static method should be a constructor.

toggle_on
Learn more
prefer_contains

Always 'false' because 'indexOf' is always greater than or equal to -1.

Always 'true' because 'indexOf' is always greater than or equal to -1.

Unnecessary use of 'indexOf' to test for containment.

toggle_on
Learn more
prefer_double_quotes

Unnecessary use of single quotes.

toggle_on
Learn more
prefer_equal_for_default_values
toggle_on
prefer_expression_function_bodies

Unnecessary use of a block function body.

toggle_on
Learn more
prefer_final_fields

The private field {0} could be 'final'.

toggle_on
Learn more
prefer_final_in_for_each

The pattern should be final.

The variable '{0}' should be final.

toggle_on
Learn more
prefer_final_locals

Local variables should be final.

toggle_on
Learn more
prefer_final_parameters

The parameter '{0}' should be final.

toggle_on
Learn more
prefer_for_elements_to_map_fromiterable

Use 'for' elements when building maps from iterables.

toggle_on
Learn more
prefer_foreach

Use 'forEach' and a tear-off rather than a 'for' loop to apply a function to every element.

toggle_on
Learn more
prefer_function_declarations_over_variables

Use a function declaration rather than a variable assignment to bind a function to a name.

toggle_on
Learn more
prefer_generic_function_type_aliases

Use the generic function type syntax in 'typedef's.

toggle_on
Learn more
prefer_if_elements_to_conditional_expressions

Use an 'if' element to conditionally add elements.

toggle_on
prefer_if_null_operators

Use the '??' operator rather than '?:' when testing for 'null'.

toggle_on
Learn more
prefer_initializing_formals

Use an initializing formal to assign a parameter to a field.

toggle_on
Learn more
prefer_inlined_adds

The addition of a list item could be inlined.

The addition of multiple list items could be inlined.

toggle_on
Learn more
prefer_int_literals

Unnecessary use of a 'double' literal.

toggle_on
prefer_interpolation_to_compose_strings

Use interpolation to compose strings and values.

toggle_on
Learn more
prefer_is_empty

The comparison is always 'false' because the length is always greater than or equal to 0.

The comparison is always 'true' because the length is always greater than or equal to 0.

Use 'isEmpty' instead of 'length' to test whether the collection is empty.

Use 'isNotEmpty' instead of 'length' to test whether the collection is empty.

toggle_on
Learn more
prefer_is_not_empty

Use 'isNotEmpty' rather than negating the result of 'isEmpty'.

toggle_on
Learn more
prefer_is_not_operator

Use the 'is!' operator rather than negating the value of the 'is' operator.

toggle_on
Learn more
prefer_iterable_wheretype

Use 'whereType' to select elements of a given type.

toggle_on
Learn more
prefer_mixin

Only mixins should be mixed in.

toggle_on
prefer_null_aware_method_calls

Use a null-aware invocation of the 'call' method rather than explicitly testing for 'null'.

toggle_on
prefer_null_aware_operators

Use the null-aware operator '?.' rather than an explicit 'null' comparison.

toggle_on
Learn more
prefer_relative_imports

Use relative imports for files in the 'lib' directory.

toggle_on
Learn more
prefer_single_quotes

Unnecessary use of double quotes.

toggle_on
Learn more
prefer_spread_collections

The addition of multiple elements could be inlined.

toggle_on
prefer_typing_uninitialized_variables

An uninitialized field should have an explicit type annotation.

An uninitialized variable should have an explicit type annotation.

toggle_on
Learn more
prefer_void_to_null

Unnecessary use of the type 'Null'.

toggle_on
Learn more
provide_deprecation_message

Missing a deprecation message.

toggle_on
Learn more
public_member_api_docs

Missing documentation for a public member.

toggle_on
Learn more
recursive_getters

The getter '{0}' recursively returns itself.

toggle_on
Learn more
require_trailing_commas

Missing a required trailing comma.

toggle_on
secure_pubspec_urls

The '{0}' protocol shouldn't be used because it isn't secure.

toggle_on
Learn more
sized_box_for_whitespace

Use a 'SizedBox' to add whitespace to a layout.

toggle_on
Learn more
sized_box_shrink_expand

Use 'SizedBox.{0}' to avoid needing to specify the 'height' and 'width'.

toggle_on
Learn more
slash_for_doc_comments

Use the end-of-line form ('///') for doc comments.

toggle_on
Learn more
sort_child_properties_last

The '{0}' argument should be last in widget constructor invocations.

toggle_on
Learn more
sort_constructors_first

Constructor declarations should be before non-constructor declarations.

toggle_on
Learn more
sort_pub_dependencies

Dependencies not sorted alphabetically.

toggle_on
Learn more
sort_unnamed_constructors_first

Invalid location for the unnamed constructor.

toggle_on
Learn more
specify_nonobvious_local_variable_types

Specify the type of a local variable when the type is non-obvious.

toggle_on
specify_nonobvious_property_types

A type annotation is needed because it isn't obvious.

toggle_on
strict_top_level_inference

Missing type annotation.

toggle_on
super_goes_last
toggle_on
test_types_in_equals

Missing type test for '{0}' in '=='.

toggle_on
Learn more
throw_in_finally

Use of '{0}' in 'finally' block.

toggle_on
Learn more
tighten_type_of_initializing_formals

Use a type annotation rather than 'assert' to enforce non-nullability.

toggle_on
Learn more
type_annotate_public_apis

Missing type annotation on a public API.

toggle_on
Learn more
type_init_formals

Don't needlessly type annotate initializing formals.

toggle_on
Learn more
type_literal_in_constant_pattern

Use 'TypeName _' instead of a type literal.

toggle_on
Learn more
unawaited_futures

Missing an 'await' for the 'Future' computed by this expression.

toggle_on
Learn more
unintended_html_in_doc_comment

Angle brackets will be interpreted as HTML.

toggle_on
Learn more
unnecessary_async

Don't make a function 'async' if it doesn't use 'await'.

toggle_on
unnecessary_await_in_return

Unnecessary 'await'.

toggle_on
unnecessary_brace_in_string_interps

Unnecessary braces in a string interpolation.

toggle_on
Learn more
unnecessary_breaks

Unnecessary 'break' statement.

toggle_on
unnecessary_const

Unnecessary 'const' keyword.

toggle_on
Learn more
unnecessary_constructor_name

Unnecessary '.new' constructor name.

toggle_on
Learn more
unnecessary_final

Local variables should not be marked as 'final'.

toggle_on
Learn more
unnecessary_getters_setters

Unnecessary use of getter and setter to wrap a field.

toggle_on
Learn more
unnecessary_ignore

The diagnostic '{0}' isn't produced at this location so it doesn't need to be ignored.

The diagnostic '{0}' isn't produced in this file so it doesn't need to be ignored.

toggle_on
Learn more
unnecessary_lambdas

Closure should be a tearoff.

toggle_on
Learn more
unnecessary_late

Unnecessary 'late' modifier.

toggle_on
Learn more
unnecessary_library_directive

Library directives without comments or annotations should be avoided.

toggle_on
unnecessary_library_name

Library names are not necessary.

toggle_on
Learn more
unnecessary_new

Unnecessary 'new' keyword.

toggle_on
Learn more
unnecessary_null_aware_assignments

Unnecessary assignment of 'null'.

toggle_on
Learn more
unnecessary_null_aware_operator_on_extension_on_nullable

Unnecessary use of a null-aware operator to invoke an extension method on a nullable type.

toggle_on
Learn more
unnecessary_null_checks

Unnecessary use of a null check ('!').

toggle_on
Learn more
unnecessary_null_in_if_null_operators

Unnecessary use of '??' with 'null'.

toggle_on
Learn more
unnecessary_nullable_for_final_variable_declarations

Type could be non-nullable.

toggle_on
Learn more
unnecessary_overrides

Unnecessary override.

toggle_on
Learn more
unnecessary_parenthesis

Unnecessary use of parentheses.

toggle_on
Learn more
unnecessary_raw_strings

Unnecessary use of a raw string.

toggle_on
Learn more
unnecessary_statements

Unnecessary statement.

toggle_on
Learn more
unnecessary_string_escapes

Unnecessary escape in string literal.

toggle_on
Learn more
unnecessary_string_interpolations

Unnecessary use of string interpolation.

toggle_on
Learn more
unnecessary_this

Unnecessary 'this.' qualifier.

toggle_on
Learn more
unnecessary_to_list_in_spreads

Unnecessary use of 'toList' in a spread.

toggle_on
Learn more
unnecessary_unawaited

Unnecessary use of 'unawaited'.

unnecessary_underscores

Unnecessary use of multiple underscores.

toggle_on
Learn more
unreachable_from_main

Unreachable member '{0}' in an executable library.

toggle_on
unrelated_type_equality_checks

The type of the operand ('{0}') isn't a subtype or a supertype of the value being matched ('{1}').

The type of the right operand ('{0}') isn't a subtype or a supertype of the left operand ('{1}').

toggle_on
Learn more
unsafe_html

Assigning to the attribute '{0}' is unsafe.

Invoking the constructor '{0}' is unsafe.

Invoking the method '{0}' is unsafe.

toggle_on
unsafe_variance

This type is unsafe: a type parameter occurs in a non-covariant position.

toggle_on
Learn more
use_build_context_synchronously

Don't use 'BuildContext's across async gaps, guarded by an unrelated 'mounted' check.

Don't use 'BuildContext's across async gaps.

toggle_on
Learn more
use_colored_box

Use a 'ColoredBox' rather than a 'Container' with only a 'Color'.

toggle_on
Learn more
use_decorated_box

Use 'DecoratedBox' rather than a 'Container' with only a 'Decoration'.

toggle_on
Learn more
use_enums

Class should be an enum.

toggle_on
use_full_hex_values_for_flutter_colors

Instances of 'Color' should be created using an 8-digit hexadecimal integer (such as '0xFFFFFFFF').

toggle_on
Learn more
use_function_type_syntax_for_parameters

Use the generic function type syntax to declare the parameter '{0}'.

toggle_on
Learn more
use_if_null_to_convert_nulls_to_bools

Use an if-null operator to convert a 'null' to a 'bool'.

toggle_on
Learn more
use_is_even_rather_than_modulo

Use '{0}' rather than '% 2'.

toggle_on
use_key_in_widget_constructors

Constructors for public widgets should have a named 'key' parameter.

toggle_on
Learn more
use_late_for_private_fields_and_variables

Use 'late' for private members with a non-nullable type.

toggle_on
Learn more
use_named_constants

Use the constant '{0}' rather than a constructor returning the same object.

toggle_on
Learn more
use_null_aware_elements

Use the null-aware marker '?' rather than a null check via an 'if'.

toggle_on
Learn more
use_raw_strings

Use a raw string to avoid using escapes.

toggle_on
Learn more
use_rethrow_when_possible

Use 'rethrow' to rethrow a caught exception.

toggle_on
Learn more
use_setters_to_change_properties

The method is used to change a property.

toggle_on
Learn more
use_string_buffers

Use a string buffer rather than '+' to compose strings.

toggle_on
Learn more
use_string_in_part_of_directives

The part-of directive uses a library name.

toggle_on
Learn more
use_super_parameters

Parameter '{0}' could be a super parameter.

Parameters '{0}' could be super parameters.

toggle_on
Learn more
use_test_throws_matchers

Use the 'throwsA' matcher instead of using 'fail' when there is no exception thrown.

toggle_on
use_to_and_as_if_applicable

Start the name of the method with 'to' or 'as'.

toggle_on
use_truncating_division

Use truncating division.

toggle_on
Learn more
valid_regexps

Invalid regular expression syntax.

toggle_on
Learn more
void_checks

Assignment to a variable of type 'void'.

toggle_on
Learn more