Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add convenience constructors to slivers that require delegates #113107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Piinks opened this issue Oct 7, 2022 · 3 comments
Closed

Add convenience constructors to slivers that require delegates #113107

Piinks opened this issue Oct 7, 2022 · 3 comments
Assignees
Labels
c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. from: study Reported in a UX study P3 Issues that are less important to the Flutter project

Comments

@Piinks
Copy link
Contributor

Piinks commented Oct 7, 2022

We have learned from user studies that delegates can be intimidating or complex for users, especially if they are learning flutter.
We have also been working on making it easier for users to compose efficient scrolling widgets - one way in particular is to make slivers more approachable so that it is easier to refactor code and avoid things like shrinkwrap.

Many slivers require delegates to be provided by the user. In non-sliver classes like ListView and GridView, convenience constructors create the delegate for the user.

  • ListView
    • list of children creates a SliverListChildDelegate
    • builder constructor creates a SliverChildBuilderDelegate
  • GridView
    • count creates a SliverGridDelegateWithCrossAxisCount
    • extent creates a SliverGridDelegateWithMaxCrossAxisExtent
  • ... and so on

We should add convenience constructors like these to the Sliver classes that require delegates. Users can still provide their own delegate if they choose, but if we can facilitate taking care of the delegate for folks, it may make slivers more friendly. :)

cc interested parties @jonahwilliams @dnfield @goderbauer @InMatrix @gspencergoog

@Piinks Piinks added c: new feature Nothing broken; request for a new capability framework flutter/packages/flutter repository. See also f: labels. f: scrolling Viewports, list views, slivers, etc. from: study Reported in a UX study c: proposal A detailed proposal for a change to Flutter labels Oct 7, 2022
@jonahwilliams
Copy link
Member

This sounds great to me :)

@InMatrix
Copy link

InMatrix commented Oct 7, 2022

Cc @melyndahoover

@goderbauer goderbauer added the P3 Issues that are less important to the Flutter project label Oct 10, 2022
@Piinks Piinks assigned thkim1011 and unassigned Piinks Nov 30, 2022
@Piinks Piinks moved this to In Progress in Scrolling Performance Pitfalls Dec 2, 2022
@Piinks Piinks closed this as completed Mar 7, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Scrolling Performance Pitfalls Mar 7, 2023
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. from: study Reported in a UX study P3 Issues that are less important to the Flutter project
Projects
Development

No branches or pull requests

5 participants