non_ constant_ identifier_ names
Learn about the non_constant_identifier_names linter rule.
Name non-constant identifiers using lowerCamelCase.
Details
#DO name non-constant identifiers using lowerCamelCase.
Class members, top-level definitions, variables, parameters, named parameters and named constructors should capitalize the first letter of each word except the first word, and use no separators.
GOOD:
var item;
HttpRequest httpRequest;
align(clearItems) {
// ...
}
Enable
#
To enable the non_constant_identifier_names rule,
add non_constant_identifier_names
under
linter > rules in your
analysis_options.yaml
file:
linter:
rules:
- non_constant_identifier_names
If you're instead using the YAML map syntax to configure
linter rules, add
non_constant_identifier_names: true under
linter > rules:
linter:
rules:
non_constant_identifier_names: true
除非另有说明,文档之所提及适用于 Dart 3.12.2 版本报告页面问题.