require_trailing_commas  
              
Use trailing commas for all parameter lists and argument lists.
Details
#DO use trailing commas for all multi-line parameter lists and argument lists. A parameter list or argument list that fits on one line, including the opening parenthesis and closing parenthesis, does not require a trailing comma.
BAD:
void run() {
  method('does not fit on one line',
      'test test test test test test test test test test test');
}GOOD:
void run() {
  method(
    'does not fit on one line',
    'test test test test test test test test test test test',
  );
}EXCEPTION: If the final argument in an argument list is positional (vs named) and is either a function literal with curly braces, a map literal, a set literal, or a list literal, then a trailing comma is not required. This exception only applies if the final argument does not fit entirely on one line.
NOTE: This lint rule assumes that code has been formatted with dart format
and may produce false positives on unformatted code.
Enable
#To enable the require_trailing_commas rule,
add require_trailing_commas under linter > rules in your
analysis_options.yaml file:
linter:
  rules:
    - require_trailing_commasIf you're instead using the YAML map syntax to configure linter rules,
add require_trailing_commas: true under linter > rules:
linter:
  rules:
    require_trailing_commas: true