do_not_use_environment

Group: style

Maturity: stable

Dart SDK: >= 2.10.0-0.0.dev • (Linter v0.1.117)

Since info is static, may be stale

View all Lint Rules

Using the Linter

Using values derived from the environment at compile-time, creates hidden global state and makes applications hard to understand and maintain.

DO NOT use fromEnvironment or hasEnvironment factory constructors.

BAD:

const loggingLevel =
  bool.hasEnvironment('logging') ? String.fromEnvironment('logging') : null;