library_private_types_in_public_api

Group: style

Maturity: stable

Dart SDK: >= 2.14.0 • (Linter v1.3.0)

Since info is static, may be stale
recommendedflutter

View all Lint Rules

Using the Linter

AVOID using library private types in public APIs.

For the purposes of this lint, a public API is considered to be any top-level or member declaration unless the declaration is library private or contained in a declaration that's library private. The following uses of types are checked:

BAD:

f(_Private p) { ... }
class _Private {}

GOOD:

f(String s) { ... }

Usage

To enable the library_private_types_in_public_api lint, add library_private_types_in_public_api under linter > rules in your analysis_options.yaml file:

linter:
  rules:
    - library_private_types_in_public_api