Skip to content

Add convenience constructors to slivers that require delegates #113107

@Piinks

Description

@Piinks

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

Metadata

Metadata

Assignees

Labels

P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterf: scrollingViewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.from: studyReported in a UX study

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions