-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.good first issueRelatively approachable for first-time contributorsRelatively approachable for first-time contributorsteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
Use case
Example:
flutter/packages/flutter/test/widgets/slivers_test.dart
Lines 465 to 481 in acfe731
| child: CustomScrollView( | |
| slivers: <Widget>[ | |
| SliverGrid( | |
| gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( | |
| crossAxisCount: 2, | |
| crossAxisSpacing: 8, | |
| mainAxisSpacing: 8, | |
| ), | |
| delegate: SliverChildListDelegate(<Widget>[ | |
| const Center(child: Text('A')), | |
| const Center(child: Text('B')), | |
| const Center(child: Text('C')), | |
| const Center(child: Text('D')), | |
| ]), | |
| ), | |
| ], | |
| ), |
Proposal
Introduce a new SliverGrid.list API, similar to the existing SliverGrid.builder API except that it accepts a List<Widget> children argument instead of a itemBuilder argument:
child: CustomScrollView(
slivers: <Widget>[
SliverGrid.list(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 8,
mainAxisSpacing: 8,
),
children: <Widget>[
const Center(child: Text('A')),
const Center(child: Text('B')),
const Center(child: Text('C')),
const Center(child: Text('D')),
],
),
],
), Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.good first issueRelatively approachable for first-time contributorsRelatively approachable for first-time contributorsteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team