Pattern: Missing doc for public API
Issue: -
Public APIs consist in everything in your package's lib
folder, minus
implementation files in lib/src
, adding elements explicitly exported with an
export
directive.
For example, given lib/foo.dart
:
export 'src/bar.dart' show Bar;
export 'src/baz.dart';
class Foo { }
class _Foo { }
its API includes:
Foo
(but not_Foo
)Bar
(exported) and- all public elements in
src/baz.dart
All public API members should be documented with ///
doc-style comments.
Example of correct code:
/// A Foo.
abstract class Foo {
/// Start foo-ing.
void start() => _start();
_start();
}
Example of incorrect code:
class Bar {
void bar();
}
Advice for writing good doc comments can be found in the Doc Writing Guidelines.