non_constant_identifier_names
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
Unless stated otherwise, the documentation on this site reflects Dart 3.6.0. Page last updated on 2025-01-27. View source or report an issue.