surfstudio / flutter-bottom-sheet

Custom bottom sheet widget, that can resize by drag and then scroll. Made by Surf 🏄
Apache License 2.0
164 stars 42 forks source link

[BUG] Error when inertia closing BottomSheet. #40

Closed KristinaZoteva closed 2 years ago

KristinaZoteva commented 2 years ago

Describe the bug

When the BottomSheet is open and the keyboard is open in it, when trying to close the BottomSheet by inertia, an error occurs: ======== Exception caught by rendering library ===================================================== The following assertion was thrown during layout: A RenderFlex overflowed by 21 pixels on the bottom.

The relevant error-causing widget was: The overflowing RenderFlex has an orientation of Axis.vertical. The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and black striped pattern. This is usually caused by the contents being too big for the RenderFlex.

Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the RenderFlex to fit within the available space instead of being sized to their natural size. This is considered an error condition because it indicates that there is content that cannot be seen. If the content is legitimately bigger than the available space, consider clipping it with a ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex, like a ListView.

Steps to Reproduce

Open BottomSheet with TextField inside, give focus to the TextField, and try to close the BottomSheet by inertia.

What is the expected behavior?

There should be no error.

Additional context

Happens on android and on iOS.

MbIXjkee commented 2 years ago

https://github.com/surfstudio/flutter-bottom-sheet/pull/54 fixed