Programming Search⌘K

Dart errors and diagnostics, page 5 of 5

The error codes and warnings of Dart, with the message that each one prints and what causes it. This page has 979 cards.

A value of type '…' can't be returned from the constructor '…' because it has a return type of '…'. return_of_invalid_type

Code
return_of_invalid_type
Severity
error
Message
A value of type '{}' can't be returned from the constructor '{}' because it has a return type of '{}'.
Message
A value of type '{}' can't be returned from the function '{}' because it has a return type of '{}'.
Message
A value of type '{}' can't be returned from the method '{}' because it has a return type of '{}'.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

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. setting_orientation_on_activity

Consider declaring the corresponding activity element with `screenOrientation="unspecified"` or `"fullSensor"` attribute.

Code
setting_orientation_on_activity
Severity
warning
Message
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

Source: github.com. JSON record. This entry is a card. Help write this page.

The mixin '…' must be 'base' because the supertype '…' is 'base'. subtype_of_base_or_final_is_not_base_final_or_sealed

Code
subtype_of_base_or_final_is_not_base_final_or_sealed
Severity
error
Message
The mixin '{}' must be 'base' because the supertype '{}' is 'base'.
Message
The mixin '{}' must be 'base' because the supertype '{}' is 'final'.
Message
The type '{}' must be 'base', 'final' or 'sealed' because the supertype '{}' is 'base'.
Message
The type '{}' must be 'base', 'final' or 'sealed' because the supertype '{}' is 'final'.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

Classes can't extend '…'. subtype_of_disallowed_type

Try specifying a different superclass, or removing the extends clause.

Code
subtype_of_disallowed_type
Severity
error
Message
Classes can't extend '{}'.
Message
Classes can't mixin '{}'.
Message
'{}' can't be used as a superclass constraint.
Message
Classes and mixins can't implement '{}'.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

The class '…' can't extend '…' because '…' is a subtype of 'Struct', 'Union', or 'AbiSpecificInteger'. subtype_of_struct_class

Try extending 'Struct', 'Union', or 'AbiSpecificInteger' directly.

Code
subtype_of_struct_class
Severity
error
Message
The class '{}' can't extend '{}' because '{}' is a subtype of 'Struct', 'Union', or 'AbiSpecificInteger'.
Message
The class '{}' can't implement '{}' because '{}' is a subtype of 'Struct', 'Union', or 'AbiSpecificInteger'.
Message
The class '{}' can't mix in '{}' because '{}' is a subtype of 'Struct', 'Union', or 'AbiSpecificInteger'.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

The type '…' of this parameter isn't a subtype of the type '…' of the associated super constructor parameter. super_formal_parameter_type_is_not_subtype_of_associated

Try removing the explicit type annotation from the parameter.

Code
super_formal_parameter_type_is_not_subtype_of_associated
Severity
error
Message
The type '{}' of this parameter isn't a subtype of the type '{}' of the associated super constructor parameter.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

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

Try specifying a different superclass, or removing the extends clause.

Code
supertype_expands_to_type_parameter
Severity
error
Message
A type alias that expands to a type parameter can't be used as a superclass.
Message
A type alias that expands to a type parameter can't be used as a superclass constraint.
Message
A type alias that expands to a type parameter can't be mixed in.
Message
A type alias that expands to a type parameter can't be implemented.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

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

Try checking that the value isn't 'null' before using it in a spread, or use a null-aware spread.

Code
unchecked_use_of_nullable_value
Severity
error
Message
A nullable expression can't be used in a spread.
Message
The function can't be unconditionally instantiated because it can be 'null'.
Message
The function can't be unconditionally invoked because it can be 'null'.
Message
The method '{}' can't be unconditionally invoked because the receiver can be 'null'.
Message
The operator '{}' can't be unconditionally invoked because the receiver can be 'null'.
Message
A nullable expression can't be used in a yield-each statement.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

The extension '…' doesn't have an instance member named '…'. undefined_extension_member_read

Try correcting the name to the name of an existing member, or defining a method or getter named '…' in the extension.

Code
undefined_extension_member_read
Severity
error
Message
The extension '{}' doesn't have an instance member named '{}'.
Message
The member '{}' is declared in '{}', but private names are visible only in their own library.
Message
There's a setter '{}' in the extension '{}', but no getter.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

There's a getter '…' in the extension '…', but no setter. undefined_extension_member_write

Try defining a setter named '…' in the extension.

Code
undefined_extension_member_write
Severity
error
Message
There's a getter '{}' in the extension '{}', but no setter.
Message
The extension '{}' doesn't have an instance setter named '{}'.
Message
The member '{}' is declared in '{}', but private names are visible only in their own library.
Message
The {} '{}' in the extension '{}' can't be assigned to.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

The member '…' isn't defined for the type '…'. undefined_instance_member_read

Try importing the library that defines '…', correcting the name to the name of an existing member, or defining a method, getter, or field named '…'.

Code
undefined_instance_member_read
Severity
error
Message
The member '{}' isn't defined for the type '{}'.
Message
The member '{}' is declared in '{}', but private names are visible only in their own library.
Message
There's a setter '{}' for the type '{}', but no getter.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

The field '…' of the type '…' is final, so it can't be assigned to. undefined_instance_member_write

Try making the field non-final, or removing the assignment.

Code
undefined_instance_member_write
Severity
error
Message
The field '{}' of the type '{}' is final, so it can't be assigned to.
Message
There's a getter '{}' for the type '{}', but no setter.
Message
The setter '{}' isn't defined for the type '{}'.
Message
The member '{}' is declared in '{}', but private names are visible only in their own library.
Message
The {} '{}' of the type '{}' can't be assigned to.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

The named parameter '…' isn't defined. undefined_named_parameter

Try correcting the name to an existing named parameter's name, or defining a named parameter with the name '…'.

Code
undefined_named_parameter
Severity
error
Message
The named parameter '{}' isn't defined.
Message
The named parameter '_{}' should use the corresponding public name '{}' at the callsite.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

The name '…' isn't defined in the libraries imported with the prefix '…'. undefined_prefixed_name_read

Try correcting the name to the name of an existing declaration, or importing the library that defines '…' with the prefix '…'.

Code
undefined_prefixed_name_read
Severity
error
Message
The name '{}' isn't defined in the libraries imported with the prefix '{}'.
Message
The name '{}' is declared in '{}', but private names are visible only in their own library.
Message
There's a setter '{}' in the libraries imported with the prefix '{}', but no getter.

Source: github.com. JSON record. This entry is a card. Help write this page.

The constant '…' imported with the prefix '…' can't be assigned to. undefined_prefixed_name_write

Try making it a non-constant variable, or removing the assignment.

Code
undefined_prefixed_name_write
Severity
error
Message
The constant '{}' imported with the prefix '{}' can't be assigned to.
Message
The variable '{}' imported with the prefix '{}' is final, so it can't be assigned to.
Message
There's a getter '{}' in the libraries imported with the prefix '{}', but no setter.
Message
The setter '{}' isn't defined in the libraries imported with the prefix '{}'.
Message
The name '{}' is declared in '{}', but private names are visible only in their own library.
Message
The {} '{}' imported with the prefix '{}' can't be assigned to.

Source: github.com. JSON record. This entry is a card. Help write this page.

The function type '…' doesn't have a static member named '…'. undefined_static_member_read

Try wrapping the function type alias in parentheses to access '…' on the 'Type' object.

Code
undefined_static_member_read
Severity
error
Message
The function type '{}' doesn't have a static member named '{}'.
Message
The context type '{}' doesn't have static members or constructors.
Message
The {} '{}' doesn't have a {} named '{}'.
Message
The context type '{}' doesn't have a {} named '{}'.
Message
The member '{}' is declared in '{}', but private names are visible only in their own library.
Message
The context type '{}' is declared in '{}', but private names are visible only in their own library.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

The constant '…' in the … '…' can't be assigned to. undefined_static_member_write

Try making it a non-constant field, or removing the assignment.

Code
undefined_static_member_write
Severity
error
Message
The constant '{}' in the {} '{}' can't be assigned to.
Message
The static field '{}' in the {} '{}' is final, so it can't be assigned to.
Message
There's a static getter '{}' in the {} '{}', but no setter.
Message
The function type '{}' doesn't have a static setter named '{}'.
Message
The {} '{}' doesn't have a static setter named '{}'.
Message
The member '{}' is declared in '{}', but private names are visible only in their own library.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

The member '…' isn't defined in a superclass of '…'. undefined_super_member_read

Try correcting the name to the name of an existing member, or defining a method, getter, or field named '…' in a superclass.

Code
undefined_super_member_read
Severity
error
Message
The member '{}' isn't defined in a superclass of '{}'.
Message
The member '{}' is declared in '{}', but private names are visible only in their own library.
Message
There's a setter '{}' in a superclass of '{}', but no getter.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

The field '…' in a superclass of '…' is final, so it can't be assigned to. undefined_super_member_write

Try making the field non-final, or removing the assignment.

Code
undefined_super_member_write
Severity
error
Message
The field '{}' in a superclass of '{}' is final, so it can't be assigned to.
Message
There's a getter '{}' in a superclass of '{}', but no setter.
Message
The setter '{}' isn't defined in a superclass of '{}'.
Message
The member '{}' is declared in '{}', but private names are visible only in their own library.
Message
The {} '{}' in a superclass of '{}' can't be assigned to.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

Undefined name '…'. undefined_unqualified_name_read

Try importing the library that defines '…', correcting the name to one that is defined, or defining the name.

Code
undefined_unqualified_name_read
Severity
error
Message
Undefined name '{}'.
Message
Undefined name '{}' used as an annotation.
Message
There's a setter '{}', but no getter.

Source: github.com. JSON record. This entry is a card. Help write this page.

The constant '…' can't be assigned to. undefined_unqualified_name_write

Try making it a non-constant variable, or removing the assignment.

Code
undefined_unqualified_name_write
Severity
error
Message
The constant '{}' can't be assigned to.
Message
'{}' is final, so it can't be assigned to.
Message
There's a getter '{}', but no setter.
Message
Undefined name '{}'.
Message
The {} '{}' can't be assigned to.

Source: github.com. JSON record. This entry is a card. Help write this page.

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

Remove the condition.

Code
unnecessary_null_comparison
Severity
warning
Message
The operand must be 'null', so the condition is always 'false'.
Message
The operand must be 'null', so the condition is always 'true'.
Message
The operand can't be 'null', so the condition is always 'false'.
Message
The operand can't be 'null', so the condition is always 'true'.

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.

Yield-each statements must be in a generator function (one marked with either 'async*' or 'sync*'). yield_in_non_generator

Try adding 'async*' or 'sync*' to the enclosing function.

Code
yield_in_non_generator
Severity
error
Message
Yield-each statements must be in a generator function (one marked with either 'async*' or 'sync*').
Message
Yield statements must be in a generator function (one marked with either 'async*' or 'sync*').

Source: github.com, dart.dev. JSON record. This entry is a card. Help write this page.