Skip to content

Allow variable-sized GridView widgets #13777

@maryx

Description

@maryx

This is a feature request.
Can we have variable-sized (non-square) GridView widgets? E.g. the example from https://docs.flutter.io/flutter/widgets/GridView-class.html:

new GridView.count(
  primary: false,
  padding: const EdgeInsets.all(20.0),
  crossAxisSpacing: 10.0,
  crossAxisCount: 2,
  children: <Widget>[
    const Text('He\'d have you all unravel at the'),
    const Text('Heed not the rabble'),
    const Text('Sound of screams but the'),
    const Text('Who scream'),
    const Text('Revolution is coming...'),
    const Text('Revolution, they...'),
  ],
)

screen shot 2017-12-27 at 11 32 21 am

This results in a lot of extra space below the text, since each grid item is square. It would be neat to set the height of each grid item. The simplest would be to set all the grid items to the same height. But we could envision the height being determined based on the height of the child widgets.

We could use a Wrap widget to have child widgets of variable heights, but then there is no scrolling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: new featureNothing broken; request for a new capabilityd: api docsIssues with https://api.flutter.dev/f: scrollingViewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.would be a good packageSeparate Flutter package should be made for this

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions