avoid_ multiple_ declarations_ per_ line
Details about the 'avoid_multiple_declarations_per_line' diagnostic produced by the Dart analyzer.
Multiple variables declared on a single line.
Description
#The analyzer produces this diagnostic when multiple variables are declared on a single line. Declaring variables on separate lines improves code readability and makes debugging easier.
Example
#The following code produces this diagnostic because multiple variables are declared on the same line:
String? foo, bar, baz;
Common fixes
#Split the variable declarations into individual lines:
String? foo;
String? bar;
String? baz;
Unless stated otherwise, the documentation on this site reflects Dart 3.13.7. Report an issue.