doc_ import_ cannot_ have_ configurations
Doc imports can't have configurations.
Description
#
The analyzer produces this diagnostic when a documentation import has one
or more
if
clauses.
Documentation imports aren't configurable.
Example
#
The following code produces this diagnostic because the documentation
import has an
if
clause:
/// @docImport 'package:meta/meta.dart' if (dart.library.io) 'dart:io';
library;
Common fixes
#Remove the if
clauses:
/// @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.