doc_ import_ cannot_ have_ prefix
Doc imports can't have prefixes.
Description
#The analyzer produces this diagnostic when a documentation import has a prefix.
Using prefixes isn't supported for documentation imports.
Example
#The following code produces this diagnostic because the documentation import declares a prefix:
/// @docImport 'package:meta/meta.dart' as a;
library;
Common fixes
#Remove the prefix:
/// @docImport 'package:meta/meta.dart';
library;
Unless stated otherwise, the documentation on this site reflects Dart 3.9.2. Page last updated on 2025-9-1. View source or report an issue.