Skip to content

DraggableScrollableSheet with dynamic height #41599

@Zazo032

Description

@Zazo032

Use case

When using a DraggableScrollableSheet with dynamic content, there's no way to set the maxChildSize parameter to the height of the builder's content.

  • If the data shown inside the widget is short, setting maxChildSize to 1.0 will show too much blank space when scrolled to the top.
  • If the data shown inside the widget is long, setting maxChildSize to 0.5 will not show all the content inside the sheet.

Proposal

Add a boolean parameter which:

  • If false, the behavior will remain unchanged.
  • If true, ignores the maxChildSize (could also assert/warn) and sets the max size of the widget to the extent of the content.
    • If there's a lot of content, the result will be the same as setting maxChildSize to 1.0.
    • If there isn't too much content, the max size of the sheet will be the size of the content inside the sheet.

The behavior will be something similar to the Column's mainAxisSize parameter when set to MainAxisSize.min.

cc/ @dnfield

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: 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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions