Skip to content

Proposal to improve List readability in this repository #146600

@nate-thegrate

Description

@nate-thegrate

Now that the switch expressions issue is close to being wrapped up (yay!), I think it'd be nice to embark on a similar cleanup for collection types.

Control Flow Collections

// before
final result = <Object>[];
result.add(value1);
if (condition) {
  result.add(value2);
}
if (list != null) {
  result.addAll(list!);
}
return result;


// after
return <Object>[
  value1,
  if (condition) value2,
  ...?list,
];

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions