Skip to content

When DraggableScrollableSheet is nested in showModalBottomSheet, minChildSize is ignored. #83273

@ryan-sf

Description

@ryan-sf

Currently, when I attempt to use a DraggableScrollableSheet inside of a showModalBottomSheet, the minChildSize is ignored and the bottom sheet closes.

Steps to Reproduce

Here is an extremely simple example of the problem that I am facing:

            showModalBottomSheet(
              enableDrag: false,
              isDismissible: false,
              backgroundColor: Colors.transparent,
              barrierColor: Colors.transparent,
              context: context,
              isScrollControlled: true,
              useRootNavigator: true,
              builder: (ctx) => DraggableScrollableSheet(
                expand: false,
                maxChildSize: .75,
                minChildSize: .3,
                builder: (context, scrollController) => Container(
                  color: Colors.white,
                  child: SingleChildScrollView(
                    controller: scrollController,
                    child: Container(
                      height: 300,
                    ),
                  ),
                ),
              ),
            );

Demo: https://dartpad.dev/bf9d3722af1afaac9bdc17a70ae17c46

Expected results: When the minChildSize is reached, scrolling is stopped and dismissal is prevented.

Actual results: The bottom sheet closes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listfound in release: 2.2Found to occur in 2.2found in release: 2.3Found to occur in 2.3frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions