Skip to content

Files

Latest commit

 

History

History
51 lines (37 loc) · 1023 Bytes

package_api_docs.md

File metadata and controls

51 lines (37 loc) · 1023 Bytes

Pattern: Missing doc for public API

Issue: -

Description

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.

Further Reading