File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -288,6 +288,24 @@ dartdoc is currently documenting. This can lead to inconsistent behavior betwee
288288packages, especially if different command lines are used for dartdoc. It is recommended to use collision-resistant
289289naming for any macros by including the package name and/or library it is defined in within the name.
290290
291+ # ## Documentation imports (`/// @docImport`)
292+
293+ Libraries that are only referenced in documentation comments (`[Future]`) can be imported with a
294+ `/// @docImport '<uri>'` comment on the `library` element, like :
295+
296+ ` ` ` dart
297+ /// @docImport 'dart:async';
298+ /// @docImport 'package:flutter/element.dart' show Element;
299+ /// @docImport '../path/to/somwhere.dart';
300+ /// @docImport 'dart:html' as 'html';
301+ library;
302+
303+ /// We can now reference [Future] from dart:async, [Element] from Flutter's element library,
304+ /// and [html.Element] from dart:html, even if none of these libraries are actually imported
305+ /// by this library.
306+ class Foo {}
307+ ` ` `
308+
291309# ## Tools
292310
293311Dartdoc allows you to filter parts of the documentation through an external tool
You can’t perform that action at this time.
0 commit comments