Skip to content

Widget previews: allow grouping/organizing previews #173871

@PiotrRogulski

Description

@PiotrRogulski

Use case

Currently, all detected previews are presented as one grid/list. It would be helpful to group previews into collapsible groups or sidebar tabs.

Proposal

Allow specifying a group (or some other "path") on a preview. An API for this could look something like:

@Preview(name: 'MyText', group: 'components')
Widget myTextPreview() {...}

@Preview(name: 'MyButton', group: 'components')
Widget myButtonPreview() {...}

@Preview(name: 'HomeScreen', group: 'screens')
Widget homeScreenPreview() {...}

Here, myTextPreview and myButtonPreview would display together, and homeScreenPreview would be shown separetely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: widget previewsIssues related to the Widget Previewer toolingc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions