surfstudio/flutter-bottom-sheet

[BUG] Scrollable area does not expand or collapse on desktop

Closed this issue · 5 comments

Describe the bug

When I try to use the flexible bottom sheet, the bottom sheet scrolls, but doesn't change its size based on scroll position as shown in the documentation.
The bottom sheet's size stays at the "initHeight".

The test code I'm using:

showFlexibleBottomSheet<void>(
              minHeight: 0.25,
              initHeight: 0.4,
              maxHeight: 0.75,
              context: context,
              builder: (context, controller, bottomSheetOffset) => SafeArea(
                child: Material(
                  child: ListView(
                    controller: controller,
                    children: [
                      Text(
                        "A",
                        style: Theme.of(context).textTheme.headline1,
                      ),
                      Text("A", style: Theme.of(context).textTheme.headline1),
                      Text("A", style: Theme.of(context).textTheme.headline1),
                      Text("A", style: Theme.of(context).textTheme.headline1),
                      Text("A", style: Theme.of(context).textTheme.headline1)
                    ],
                  ),
                ),
              ),
              anchors: [0.25, 0.4, 0.75],
            ))

Steps to Reproduce

  1. Show the sheet using the code above.
  2. Scroll inside the sheet.

What is the expected behavior?

I would expect the sheet to both scroll and resize to its maxHeight.

(As it is, it scrolls, but doesn't change in size.)

Additional context

  • What package and OS are affected by this issue? Did this work in previous versions of a package?
    I'm using v 2.1.0 and building for macOS.

Could this perhaps be related to DraggableScrollableSheet not working correctly on the desktop? (See this Stack Overflow question or this Flutter issue.)

@12people I saw your code and even run the code you have provide and observed that you are providing maxHeight which is stopping the bottom sheet from scrolling above that. if you remove the maxheight it will work fine.
Thanks

@Mohit-Joshi-dev
I know what maxHeight does and the problem is not with that.
It seems to me that the problem is with the sheet behaving differently on the desktop than on mobile. It always stays at initHeight and never reaches maxHeight in an app built for macOS.

Hi, thank you for information. Unfortunately it look like a problem with DraggableScrollableSheet which we also use under the hood. It should be work when flutter/flutter#101903 will fixed.

@12people Currently it works (macOS 12.6, Flutter 3.3.2)

2022-09-27.16.40.29.mov