Skip to content

Proposal to improve List readability in this repository #146600

Closed

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,
];

Activity

  1. added
    in triagePresently being triaged by the triage team
    frameworkflutter/packages/flutter repository. See also f: labels.
    c: proposalA detailed proposal for a change to Flutter
    and removed
    in triagePresently being triaged by the triage team
    on Apr 11, 2024
  2. added
    P3Issues that are less important to the Flutter project
    on Apr 12, 2024
  3. nate-thegrate commented on May 3, 2024

    @nate-thegrate
    ContributorAuthor

    Originally I was thinking about refactoring a bunch of itemBuilder callbacks after the control flow collections were done, but it's a lot of hassle (both the refactoring and the review process) for barely any benefit.

    I'm going to mark this as "completed" and move on to more exciting stuff! :)

  4. added
    r: fixedIssue is closed as already fixed in a newer version
    on May 3, 2024
  5. github-actions commented on May 17, 2024

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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