Programming Search⌘K

Dart errors and diagnostics, page 3 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.

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

Try changing the import to not be deferred, or rename the function in the imported library.

Code
import_deferred_library_with_load_function
Severity
hint
Message
The imported library defines a top-level function named 'loadLibrary' that is hidden by deferring this library.

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

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: '…'. integer_literal_imprecise_as_double

Try using the class 'BigInt', or switch to the closest valid double: '…'.

Code
integer_literal_imprecise_as_double
Severity
error
Message
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: '{}'.

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

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

Try removing the exceptional return value.

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

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

The member '…' can't be exported as a part of a package's public API, but is indirectly exported as part of the signature of '…'. invalid_export_of_internal_element_indirectly

Try using a hide clause to hide '…'.

Code
invalid_export_of_internal_element_indirectly
Severity
warning
Message
The member '{}' can't be exported as a part of a package's public API, but is indirectly exported as part of the signature of '{}'.

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

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

Try using 'int', 'double', 'Array', 'Pointer', or subtype of 'Struct' or 'Union'.

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

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

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

Try combining into a single pattern if possible, or enclose the inner pattern in parentheses.

Code
invalid_inside_unary_pattern
Severity
error
Message
This pattern cannot appear inside a unary pattern (cast pattern, null check pattern, or null assert pattern) without parentheses.

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

The language version override can't specify a version greater than the latest known language version: ….…. invalid_language_version_override

Try removing the language version override.

Code
invalid_language_version_override
Severity
warning
Message
The language version override can't specify a version greater than the latest known language version: {}.{}.
Message
The Dart language version override number must begin with '@dart'.
Message
The language version override must be specified before any declaration or directive.
Message
The Dart language version override comment must be specified with the word 'dart' in all lower case.
Message
The Dart language version override comment must be specified with a version number, like '2.0', after the '=' character.
Message
The Dart language version override number can't be prefixed with a letter.

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

The receiver can't be null, so the null-aware operator '…' is unnecessary. invalid_null_aware_operator

Try replacing the operator '…' with '…'.

Code
invalid_null_aware_operator
Severity
warning
Message
The receiver can't be null, so the null-aware operator '{}' is unnecessary.
Message
The receiver can't be 'null' because of short-circuiting, so the null-aware operator '{}' can't be used.
Message
The element can't be null, so the null-aware operator '?' is unnecessary.
Message
The map entry key can't be null, so the null-aware operator '?' is unnecessary.
Message
The map entry value can't be null, so the null-aware operator '?' is unnecessary.

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

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

Try declaring the variable pattern with the same type and finality in all cases.

Code
invalid_pattern_variable_in_shared_case_scope
Severity
error
Message
The variable '{}' doesn't have the same type and/or finality in all cases that share this body.
Message
The variable '{}' is not available because there is a label or 'default' case.
Message
The variable '{}' is available in some, but not all cases that share this body.

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

A value of type '…' can't be returned by the 'onError' handler because it must be assignable to '…', as required by 'Future.then'. invalid_return_type_for_then

Code
invalid_return_type_for_then
Severity
warning
Message
A value of type '{}' can't be returned by the 'onError' handler because it must be assignable to '{}', as required by 'Future.then'.
Message
The return type '{}' isn't assignable to '{}', as required by 'Future.then'.

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

Constant list literals can't use a type parameter in a type argument, such as '…'. invalid_type_argument_in_const_literal

Try replacing the type parameter with a different type.

Code
invalid_type_argument_in_const_literal
Severity
error
Message
Constant list literals can't use a type parameter in a type argument, such as '{}'.
Message
Constant map literals can't use a type parameter in a type argument, such as '{}'.
Message
Constant set literals can't use a type parameter in a type argument, such as '{}'.

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

The class '…' can't be implemented outside of its library because it's a base class. invalid_use_of_type_outside_library

Code
invalid_use_of_type_outside_library
Severity
error
Message
The class '{}' can't be implemented outside of its library because it's a base class.
Message
The mixin '{}' can't be implemented outside of its library because it's a base mixin.
Message
The class '{}' can't be extended outside of its library because it's a final class.
Message
The class '{}' can't be implemented outside of its library because it's a final class.
Message
The class '{}' can't be used as a mixin superclass constraint outside of its library because it's a final class.
Message
The class '{}' can't be extended outside of its library because it's an interface class.

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

The '@JS' annotation on an extension type constructor has no effect and is disallowed. js_interop_extension_constructor_js_annotation_has_no_effect

Try removing the '@JS' annotation from the constructor, and putting it on the extension type to rename non-object literal constructors.

Code
js_interop_extension_constructor_js_annotation_has_no_effect
Severity
error
Message
The '@JS' annotation on an extension type constructor has no effect and is disallowed.

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

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

Try adding either an explicit non-'null' default value or the 'required' modifier.

Code
missing_default_value_for_parameter
Severity
error
Message
The parameter '{}' can't have a value of 'null' because of its type, but the implicit default value is 'null'.
Message
With null safety, use the 'required' keyword, not the '@required' annotation.

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

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

Try adding an exceptional return value.

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

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