Diagnostic messages
An index of the diagnostics produced by the Dart analyzer.
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.
@experimental: {0}.assert can't be used as an expression.await expressions are not supported in late local initializers.default keyword.@pragma('vm:deeply-immutable').int, double,
Pointer, or a subtype of Struct or Union.@Native annotation.super because it declares 'call' to be something other than a method.@JSExport on it or any of its members.@JSExport annotation on the class or mixin '{0}' will be ignored.void Function().external. Only factories and static methods
can be non-external.@staticInterop annotation, but has supertype '{1}', which does.@staticInterop classes should not contain any generative constructors.@staticInterop type.@staticInterop classes should also have the @JS annotation.@staticInterop classes can not be used.@trustTypes annotation, but @trustTypes is only
supported within the sdk.@trustTypes annotation, but no @staticInterop
annotation.@staticInterop annotation cannot declare instance members.@staticInterop annotation, but has supertype '{1}', which
does not.late keyword.null encountered as case in a switch expression with a non-nullable enum type.null encountered as case in a switch expression with a non-nullable type.null encountered as case in a switch statement with a non-nullable type.null encountered as the result from expression with type Never.<activity> element should be allowed to be resized to allow users to take advantage
of the multi-window environment on Chrome OSRecordUse annotation cannot be placed on this element.RecordUse annotations are only supported in libraries with a package: URI..call(...)<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 OSwasm:import and wasm:export are for internal use only and cannot be
used by user code.Unless stated otherwise, the documentation on this site reflects Dart 3.11.0. Page last updated on 2025-09-15. View source or report an issue.