Skip to content

DraggableScrollableSheet gets stuck and won't move #31739

Closed

Description

@mrmko
If maxChildSize is set to 1.0 and actual fractional value of the parent is less than 1.0 (child can't fill parent completly), then once DraggableScrollableSheet reaches its max it won't scroll back down.

Steps to Reproduce

  1. Create a DraggableScrollableSheet with maxChildSize set to 1.0
  2. Set the parent containers actual fractional value to less than 1.0
  3. Run app and scroll the sheet to its highest position. (it will get stuck)

https://gist.github.com/mrmko/40e34852fff8686753e0e9b8b5234784

@dnfield

Activity

  1. dnfield commented on Apr 28, 2019

    @dnfield
    Contributor

    While I agree something is wrong here, I'm not really sure what the expected behavior would be.

    As far as I can tell, you don't actually have enough content in your list for it to actuall scroll.

    Do you expect this to be able to somehow keep dragging to the top of the scaffold, and then be dragged back down? Do you expect it to stop when there's no more scroll extent, and then be able to drag it back down?

  2. added
    f: scrollingViewports, list views, slivers, etc.
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Apr 28, 2019
  3. modified the milestones: April 2019, on Apr 28, 2019
  4. dnfield commented on Apr 28, 2019

    @dnfield
    Contributor

    For instance, if you change your widget to instead have a maxChildSize of 0.33, are you seeing the expected behavior?

  5. Zazo032 commented on Apr 28, 2019

    @Zazo032
    Contributor

    There's not much information in material docs explaining how it should behave, but as you can see in Google Tasks bottom sheet menu, it stops when there's no more scroll extent, and then you can only drag to close it. That might be the expected behavior, but more docs in material.io according to this case would be nice @dnfield

  6. dnfield commented on Apr 28, 2019

    @dnfield
    Contributor
  7. orteney commented on Apr 28, 2019

    @orteney

    Hello, i'm also facing some kind of freezing when used DraggableScrollableSheet in showModalBottomSheet. If you has ListView with children more than 0.5 and less than 1.0 of parent height, then when you expand sheet you're unable to tap on buttons. In that case any tap registered as tap on body and closes ModalBottomSheet.

    Here minimal example: https://gist.github.com/orteney/fc48aab118a52668b59e5b0dc58ea109
    Please, modify button's count to get described childred height :)

  8. pacificwarrior commented on Apr 29, 2019

    @pacificwarrior

    I can confirm this as well. Here is a minimal example taken straight from the source:

    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        home: Scaffold(
          appBar: AppBar(),
          body: SizedBox.expand(
            child: DraggableScrollableContainer(
              initialChildSize: 0.2,
              minChildSize: 0.2,
              builder: (BuildContext context, ScrollController scrollController) {
                return Container(
                  color: Colors.blue[100],
                  child: ListView.builder(
                    controller: scrollController,
                    // Setting this to a higher value (eg. 25) will resolve the issue
                    itemCount: 5,
                    itemBuilder: (BuildContext context, int index) {
                      return ListTile(title: Text('Item $index'));
                    },
                  );
                );
              }
            ),
          ),
        )
      );
    }
  9. self-assigned this
    on Apr 30, 2019
  10. modified the milestones: , June 2019 on Apr 30, 2019
  11. dnfield commented on Apr 30, 2019

    @dnfield
    Contributor

    #31832 should fix this - anyone experiencing this, please verify that it does.

  12. cpboyd commented on Jul 14, 2019

    @cpboyd

    @dnfield What about if we want a DraggableScrollableSheet to be exactly 1.0 at all times?
    Like the "Filters" bottom sheet in Google's own Google I/O 2019 app?

          return DraggableScrollableSheet(
            builder: scroll,
            initialChildSize: 1.0,
            minChildSize: 1.0,
          );

    It currently breaks the ability to scroll the sheet and only ever dismisses it when you interact.

    This is potentially also related to a request for drag length in #34111

  13. dnfield commented on Jul 15, 2019

    @dnfield
    Contributor

    I'm not sure why you'd use this widget if you want it to be 1.0 at all times - perhaps you could open a new issue with your use case? Feel free to tag me in it.

  14. github-actions commented on Aug 29, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  15. locked as resolved and limited conversation to collaborators on Aug 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

f: scrollingViewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.waiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions